> 2016/11/18 12:28、Michael McCall <[email protected]> のメール:
> Keisuke made a reference to using Not(Nil( $p))) and Type($p->) following Get 
> pointer.
> I played with that but can't quite see how that would work.

I was thinking of something like:

> C_TEXT(V1)
> C_REAL(V2)
>
> ARRAY TEXT($names;2)
> $names{1}:="V1"
> $names{2}:="V2"
>
> ARRAY TEXT($values;2)
> $values{1}:="abc"
> $values{2}:="123"
>
> For ($i;1;Size of array($names))
>
>       ON ERR CALL("myErrorHandler")
>       $p:=Get pointer($names{$i})
>       ON ERR CALL("")
>
>       If (Not(Nil($p)))
>               $type:=Type($p->)
>               Case of
>                       : ($type=Is text)
>                               $p->:=$values{$i}
>                       : ($type=Is real)
>                               $p->:=Num($values{$i})
>               End case
>       End if
>
> End for


an error handler is needed because Get pointer will throw an error if the 
string doesn't evaluate as a variable.

e.g. Get pointer("type")


宮古 啓介
セールス・エンジニア

株式会社フォーディー・ジャパン
〒150-0043
東京都渋谷区道玄坂1-10-2 渋谷THビル6F
Tel: 03-6427-8441
Fax: 03-6427-8449

[email protected]
www.4D.com/JP

**********************************************************************
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:[email protected]
**********************************************************************

Reply via email to