FoxInCloud
MethExec
Gravatar is a globally recognized avatar based on your email address. MethExec
  Tuvia Vinitsky
  All
  Aug 4, 2015 @ 11:46am
is it possible to pass an array? If so I do not seem to be doing it correctly:

var pFile = ['File1', 'File2', 'File3'];
FoxInCloud.MethExec('updatesignatures','signature_scx','updatesignatures',pFile) ;

I get the first element only.

I want to use an array since MethExec seems to allow only one parameter.

Thanks

Gravatar is a globally recognized avatar based on your email address. Re: MethExec
  FoxInCloud Support - Thierry N.
  Tuvia Vinitsky
  Aug 5, 2015 @ 12:59am
Tuvia,

Yes, FoxInCloud.MethExec() supports a value of any type

Just to be sure, we've implemented a sample here: http://foxincloud.com/tutotest/wFormStandardPage.tuto?awForm=Modal.scx > do form (adapted) > click button 'execute method';

You can also see the source code on line (pretty simple)

Note: VFP does not support passing a parameter by reference (necessary for an array) to a VFP method source of a bindEvent()


is it possible to pass an array? If so I do not seem to be doing it correctly:

var pFile = ['File1', 'File2', 'File3'];
FoxInCloud.MethExec('updatesignatures','signature_scx','updatesignatures',pFile) ;

I get the first element only.

I want to use an array since MethExec seems to allow only one parameter.

Thanks

Gravatar is a globally recognized avatar based on your email address. Re: MethExec
  FoxInCloud Support - Thierry N.
  Tuvia Vinitsky
  Aug 5, 2015 @ 06:04am
updated with an array of various types (N, L, C, D)
if m.thisForm.wlHTMLgen
return Textmerge("FoxInCloud.MethExec(event, '<<m.this.wcID>>', 'wFormCallBack', [1, true, 'test', new Date()])")
endif


Tuvia,

Yes, FoxInCloud.MethExec() supports a value of any type

Just to be sure, we've implemented a sample here: http://foxincloud.com/tutotest/wFormStandardPage.tuto?awForm=Modal.scx > do form (adapted) > click button 'execute method';

You can also see the source code on line (pretty simple)

Note: VFP does not support passing a parameter by reference (necessary for an array) to a VFP method source of a bindEvent()


is it possible to pass an array? If so I do not seem to be doing it correctly:

var pFile = ['File1', 'File2', 'File3'];
FoxInCloud.MethExec('updatesignatures','signature_scx','updatesignatures',pFile) ;

I get the first element only.

I want to use an array since MethExec seems to allow only one parameter.

Thanks


Gravatar is a globally recognized avatar based on your email address. Re: MethExec
  Tuvia Vinitsky
  Thierry Nivelet (FoxInCloud)
  Aug 5, 2015 @ 07:12pm
Thanks, passing by reference was the issue. I should have thought of that.


Tuvia,

Yes, FoxInCloud.MethExec() supports a value of any type

Just to be sure, we've implemented a sample here: http://foxincloud.com/tutotest/wFormStandardPage.tuto?awForm=Modal.scx > do form (adapted) > click button 'execute method';

You can also see the source code on line (pretty simple)

Note: VFP does not support passing a parameter by reference (necessary for an array) to a VFP method source of a bindEvent()


is it possible to pass an array? If so I do not seem to be doing it correctly:

var pFile = ['File1', 'File2', 'File3'];
FoxInCloud.MethExec('updatesignatures','signature_scx','updatesignatures',pFile) ;

I get the first element only.

I want to use an array since MethExec seems to allow only one parameter.

Thanks


Gravatar is a globally recognized avatar based on your email address. Re: MethExec
  FoxInCloud Support - Thierry N.
  Tuvia Vinitsky
  Aug 5, 2015 @ 09:05pm
Thanks, passing by reference was the issue. I should have thought of that.

An issue only if your target method has a delegate through bindEvent()

When the method has no delegate FAS passes the value by reference - otherwise raises an error

In case the target method has a delegate and the value to be passed as parameter is an array, we can linearize this array;
in such case your method code would look like:

lparameters taValue
external array taValue

local success;
, laValue[1];
, nRow, nCol

success = .T.

do case
case Type('taValue', 1) == 'A'
nRow = Alen(taValue, 1)
nCol = Alen(taValue, 2)
if m.nCol > 0
dimension laValue[m.nRow, m.nCol]
else
dimension laValue[m.nRow]
endif
Acopy(taValue, laValue)
case Vartype(m.taValue) == 'C'
nRow = uValue(m.taValue, 'A', @m.laValue) && 'A' support to be developed
otherwise
assert .F. message 'unhandled parameter type'
success = .F.
endcase

if m.success
* ... process laValue ...
endif

please let me know if this would help

Gravatar is a globally recognized avatar based on your email address. Re: MethExec
  Tuvia Vinitsky
  Thierry Nivelet (FoxInCloud)
  Aug 5, 2015 @ 11:05pm
Useful but probably not a high priority, so depends on amount of effort required to test etc on your end.


Thanks, passing by reference was the issue. I should have thought of that.

An issue only if your target method has a delegate through bindEvent()

When the method has no delegate FAS passes the value by reference - otherwise raises an error

In case the target method has a delegate and the value to be passed as parameter is an array, we can linearize this array;
in such case your method code would look like:

lparameters taValue
external array taValue

local success;
, laValue[1];
, nRow, nCol

success = .T.

do case
case Type('taValue', 1) == 'A'
nRow = Alen(taValue, 1)
nCol = Alen(taValue, 2)
if m.nCol > 0
dimension laValue[m.nRow, m.nCol]
else
dimension laValue[m.nRow]
endif
Acopy(taValue, laValue)
case Vartype(m.taValue) == 'C'
nRow = uValue(m.taValue, 'A', @m.laValue) && 'A' support to be developed
otherwise
assert .F. message 'unhandled parameter type'
success = .F.
endcase

if m.success
* ... process laValue ...
endif

please let me know if this would help

Gravatar is a globally recognized avatar based on your email address. Re: MethExec
  FoxInCloud Support - Thierry N.
  Tuvia Vinitsky
  Aug 6, 2015 @ 03:05am
sort terms priorities are:
- release v 2.20
- remote view progressive fetching support
- !grid.Enabled
- this?


Useful but probably not a high priority, so depends on amount of effort required to test etc on your end.


Thanks, passing by reference was the issue. I should have thought of that.

An issue only if your target method has a delegate through bindEvent()

When the method has no delegate FAS passes the value by reference - otherwise raises an error

In case the target method has a delegate and the value to be passed as parameter is an array, we can linearize this array;
in such case your method code would look like:

lparameters taValue
external array taValue

local success;
, laValue[1];
, nRow, nCol

success = .T.

do case
case Type('taValue', 1) == 'A'
nRow = Alen(taValue, 1)
nCol = Alen(taValue, 2)
if m.nCol > 0
dimension laValue[m.nRow, m.nCol]
else
dimension laValue[m.nRow]
endif
Acopy(taValue, laValue)
case Vartype(m.taValue) == 'C'
nRow = uValue(m.taValue, 'A', @m.laValue) && 'A' support to be developed
otherwise
assert .F. message 'unhandled parameter type'
success = .F.
endcase

if m.success
* ... process laValue ...
endif

please let me know if this would help



-- thn (FoxInCloud)

Gravatar is a globally recognized avatar based on your email address. Re: MethExec
  Tuvia Vinitsky
  Thierry Nivelet (FoxInCloud)
  Aug 6, 2015 @ 04:24am
Fine by me.


sort terms priorities are:
- release v 2.20
- remote view progressive fetching support
- !grid.Enabled
- this?


Useful but probably not a high priority, so depends on amount of effort required to test etc on your end.


Thanks, passing by reference was the issue. I should have thought of that.

An issue only if your target method has a delegate through bindEvent()

When the method has no delegate FAS passes the value by reference - otherwise raises an error

In case the target method has a delegate and the value to be passed as parameter is an array, we can linearize this array;
in such case your method code would look like:

lparameters taValue
external array taValue

local success;
, laValue[1];
, nRow, nCol

success = .T.

do case
case Type('taValue', 1) == 'A'
nRow = Alen(taValue, 1)
nCol = Alen(taValue, 2)
if m.nCol > 0
dimension laValue[m.nRow, m.nCol]
else
dimension laValue[m.nRow]
endif
Acopy(taValue, laValue)
case Vartype(m.taValue) == 'C'
nRow = uValue(m.taValue, 'A', @m.laValue) && 'A' support to be developed
otherwise
assert .F. message 'unhandled parameter type'
success = .F.
endcase

if m.success
* ... process laValue ...
endif

please let me know if this would help



© 1996-2024