FoxInCloud
ComboBox ListIndex_Assign
Gravatar is a globally recognized avatar based on your email address. ComboBox ListIndex_Assign
  n/a
  All
  Jul 3, 2015 @ 02:02am
During testing I got a "Function requires buffered tables..." error, so I dug around some code I can't explain. In awcbo.ListIndex_Assign the following snippet:

if .T.;
and Type('m.thisForm.wlPropsRestore') == 'L' AND m.thisForm.wlPropsRestore;
and Used(m.lcAlias);
and CursorGetProp("Buffering", m.lcAlias) > 0;
and lField(m.lcField, m.lcAlias)

lnFldState = GetFldState(m.lcField, m.lcAlias)
llFldState = Vartype(m.lnFldState) == 'N'
endif

GetFldState(m.lcField, m.lcAlias) will throw an error if m.lcAlias is not buffered. In the test to insure buffering we have CursorGetProp("Buffering", m.lcAlias) > 0, which is always TRUE as CursorGetProp() returns a number between 1 and 5. Should this be CursorGetProp("Buffering", m.lcAlias) > 1?

- James

Gravatar is a globally recognized avatar based on your email address. Re: ComboBox ListIndex_Assign
  FoxInCloud Support - Thierry N.
  James Patterson
  Jul 5, 2015 @ 04:09am
James,

You're probably right, looks like a bug on a quite old code snippet.

Strangely no one ever hit it before

Thanks!


During testing I got a "Function requires buffered tables..." error, so I dug around some code I can't explain. In awcbo.ListIndex_Assign the following snippet:

if .T.;
and Type('m.thisForm.wlPropsRestore') == 'L' AND m.thisForm.wlPropsRestore;
and Used(m.lcAlias);
and CursorGetProp("Buffering", m.lcAlias) > 0;
and lField(m.lcField, m.lcAlias)

lnFldState = GetFldState(m.lcField, m.lcAlias)
llFldState = Vartype(m.lnFldState) == 'N'
endif

GetFldState(m.lcField, m.lcAlias) will throw an error if m.lcAlias is not buffered. In the test to insure buffering we have CursorGetProp("Buffering", m.lcAlias) > 0, which is always TRUE as CursorGetProp() returns a number between 1 and 5. Should this be CursorGetProp("Buffering", m.lcAlias) > 1?

- James


-- thn (FoxInCloud)

Gravatar is a globally recognized avatar based on your email address. Re: ComboBox ListIndex_Assign
  n/a
  Thierry Nivelet (FoxInCloud)
  Jul 6, 2015 @ 01:27pm
Yeah, leave it to me! It was quite by accident as I was trying to find an error in my code.

Thanks - James


James,

You're probably right, looks like a bug on a quite old code snippet.

Strangely no one ever hit it before

Thanks!


During testing I got a "Function requires buffered tables..." error, so I dug around some code I can't explain. In awcbo.ListIndex_Assign the following snippet:

if .T.;
and Type('m.thisForm.wlPropsRestore') == 'L' AND m.thisForm.wlPropsRestore;
and Used(m.lcAlias);
and CursorGetProp("Buffering", m.lcAlias) > 0;
and lField(m.lcField, m.lcAlias)

lnFldState = GetFldState(m.lcField, m.lcAlias)
llFldState = Vartype(m.lnFldState) == 'N'
endif

GetFldState(m.lcField, m.lcAlias) will throw an error if m.lcAlias is not buffered. In the test to insure buffering we have CursorGetProp("Buffering", m.lcAlias) > 0, which is always TRUE as CursorGetProp() returns a number between 1 and 5. Should this be CursorGetProp("Buffering", m.lcAlias) > 1?

- James


© 1996-2024