Re: Command numbers and names and using Execute

2017-09-22 Thread Arnaud de Montard via 4D_Tech

> Le 21 sept. 2017 à 19:24, Pat Bensky via 4D_Tech <4d_tech@lists.4d.com> a 
> écrit :
> 
> FYI - in V15 and later you don't need to bother with the command numbers
> any more:

I still bother because of this:
"Since a command name may vary from one 4D version to
the next (commands renamed)"
Who can say names won't change? (I hope all those not beginning by the chapter 
name _will_ change)
And such command names are often uneasy to find/replace. 

-- 
Arnaud 


**
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:4d_tech-unsubscr...@lists.4d.com
**

Re: Command numbers and names and using Execute

2017-09-22 Thread Nigel Greenlee via 4D_Tech
Pat


An excellent point. 

Where i think that won't work though-if i am understanding correctly is this...

 Lets say i write the following piece of very odd code(why you would write this 
i do not know but its an example)..

if(themoonisblue)
$_t_ExecuteText:=(“Array Text($_at_MyText;0)”)
else
$_t_ExecuteText:=(“Array longint($_al_MyLongint;0)”)
end if
Execute formula($_t_ExecuteText)

and presumably if you are using Footrunner(maybe that tokenises the code so 
maybe footrunner does not have a localization issue) or your own version of 
code from text(like what I have) then it also would still need manual 
translation to either the local command name or the command ID

if you are doing something like the above- reading the V16 manual- you need to 
modify the way the text is stored to modify the syntax to the tokensyntax-so 
using the command number of the command typed and storing that as :Cxxx as 
described in Miyakos email. 

Actually that new syntax is really useful if you are running code from text via 
a series of execute statements as not only will it cope with localization but 
also field/table renaming-although for me my approach will be to create the 
tokenised version of the text as extra field.


Nigel Greenlee


> On 21 Sep 2017, at 18:24, Pat Bensky via 4D_Tech <4d_tech@lists.4d.com> wrote:
> 
> FYI - in V15 and later you don't need to bother with the command numbers
> any more:
> 
> "
> Compatibility note: Since a command name may vary from one 4D version to
> the next (commands renamed), this command was used in previous versions
> 
> of the program to designate a command directly by means of its number,
> especially in non-tokenized portions of code. This need has diminished over
> time as
> 
> 4D continues to evolve because, for non-tokenized statements (formulas), 4D
> now provides a token syntax. This syntax allows you to avoid potential
> problems
> 
> due to variations in command names as well as other elements such as
> tables, while still being able to type these names in a legible manner (for
> more
> 
> information about this point, refer to the Using tokens in formulas section).
> Furthermore, by default, the English language version is used starting with
> 4D
> 
> v15; however, the "Use regional system settings" option on the Methods Page of
> the Preferences allows you to continue using the French language in a
> 
> French version of 4D."
> 
> HTH!
> Pat
> 
> On 21 September 2017 at 17:39, Arnaud de Montard via 4D_Tech <
> 4d_tech@lists.4d.com> wrote:
> 
>> 
>>> Le 21 sept. 2017 à 17:51, Nigel Greenlee via 4D_Tech <
>> 4d_tech@lists.4d.com> a écrit :
>>> 
>>> For ($i;1;1)  //well i know there are less than 1 commands for
>> the next few years at least:)
>> 
>> you can exit the loop when ok = 0, see here:
>> 
>> 
>> --
>> Arnaud
>> 
>> 
>> **
>> 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:4d_tech-unsubscr...@lists.4d.com
>> **
>> 
> 
> 
> 
> -- 
> *
> CatBase - Top Dog in Data Publishing
> tel: +44 (0) 207 118 7889
> w: http://www.catbase.com
> skype: pat.bensky
> *
> **
> 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:4d_tech-unsubscr...@lists.4d.com
> **

**
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:4d_tech-unsubscr...@lists.4d.com
**

Re: Command numbers and names and using Execute

2017-09-21 Thread Pat Bensky via 4D_Tech
FYI - in V15 and later you don't need to bother with the command numbers
any more:

"
Compatibility note: Since a command name may vary from one 4D version to
the next (commands renamed), this command was used in previous versions

of the program to designate a command directly by means of its number,
especially in non-tokenized portions of code. This need has diminished over
time as

4D continues to evolve because, for non-tokenized statements (formulas), 4D
now provides a token syntax. This syntax allows you to avoid potential
problems

due to variations in command names as well as other elements such as
tables, while still being able to type these names in a legible manner (for
more

information about this point, refer to the Using tokens in formulas section).
Furthermore, by default, the English language version is used starting with
4D

v15; however, the "Use regional system settings" option on the Methods Page of
the Preferences allows you to continue using the French language in a

French version of 4D."

HTH!
Pat

On 21 September 2017 at 17:39, Arnaud de Montard via 4D_Tech <
4d_tech@lists.4d.com> wrote:

>
> > Le 21 sept. 2017 à 17:51, Nigel Greenlee via 4D_Tech <
> 4d_tech@lists.4d.com> a écrit :
> >
> > For ($i;1;1)  //well i know there are less than 1 commands for
> the next few years at least:)
>
> you can exit the loop when ok = 0, see here:
> 
>
> --
> Arnaud
>
>
> **
> 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:4d_tech-unsubscr...@lists.4d.com
> **
>



-- 
*
CatBase - Top Dog in Data Publishing
tel: +44 (0) 207 118 7889
w: http://www.catbase.com
skype: pat.bensky
*
**
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:4d_tech-unsubscr...@lists.4d.com
**

Re: Command numbers and names and using Execute

2017-09-21 Thread Arnaud de Montard via 4D_Tech

> Le 21 sept. 2017 à 17:51, Nigel Greenlee via 4D_Tech <4d_tech@lists.4d.com> a 
> écrit :
> 
> For ($i;1;1)  //well i know there are less than 1 commands for the 
> next few years at least:)

you can exit the loop when ok = 0, see here:


-- 
Arnaud 


**
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:4d_tech-unsubscr...@lists.4d.com
**

Re: Command numbers and names and using Execute

2017-09-21 Thread Paul Lovejoy via 4D_Tech
Thanks!


> Le 21 sept. 2017 à 18:05, Keisuke Miyako via 4D_Tech <4d_tech@lists.4d.com> a 
> écrit :
> 
> ARRAY TEXT is command #222 so you could do
> 
> EXECUTE FORMULA(":C222(...)")
> 
> C must be uppercase.
> 
> c.f.
> 
> http://doc.4d.com/4Dv16/4D/16.2/Using-tokens-in-formulas.300-3432926.en.html
> 
>> 2017/09/22 0:34、Paul Lovejoy via 4D_Tech <4d_tech@lists.4d.com> のメール:
>> 
>> I want to use the Execute command in a multi-lingual environment use it to 
>> execute 4D commands such as ARRAY TEXT(). Of course, this would fail as is 
>> on a French version of 4D. I believe there’s a way to use Execute() with the 
>> internal command numbers but I can’t find anything in the docs or the 
>> knowledge base.
>> Does anyone know how to do this?
> 
> 
> 
> **
> 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:4d_tech-unsubscr...@lists.4d.com
> **

**
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:4d_tech-unsubscr...@lists.4d.com
**

Re: Command numbers and names and using Execute

2017-09-21 Thread Paul Lovejoy via 4D_Tech
Thanks Nigel!


> Le 21 sept. 2017 à 17:51, Nigel Greenlee via 4D_Tech <4d_tech@lists.4d.com> a 
> écrit :
> 
> Paul.
> 
> When i was writing my rather excellent(even though i say so myself) auto 
> variable declaring code I wanted the command and command numbers. I just 
> looked up what i did
> 
> I ran this bit of code :- 
> ARRAY TEXT(SC_at_CommandNames;0)
> For ($i;1;1)//well i know there are less than 1 commands for the next 
> few years at least:)
> 
>  $_t_CommandName:=Command name($i)
>If ($_t_CommandName#"")
>   APPEND TO ARRAY(SC_at_CommandNames;$_t_CommandName)
>End if 
> End for 
> 
> Now of course you could store the command id ($i) in an array write the 
> ‘English’ command  name and number to an xml. and when in a French version 
> load the ‘French names’ and IDS compare them to the ones in your text and 
> replace the english command with the french command or execute the command by 
> ID
> storing your text in the following format:
> 
> 
> $_t_CommandName:=Get_CommandName($EnglishCommand)<-in which you lookup the ID 
> of the command in your xml document(veryfast) and return the ID of that 
> command and then get the localised command name
> 
> or you could store a version of your text in which the name is replaced with:
> $_t_CommandName:=Command name(numberofcommand) when you save the text of your 
> execute-in this case you could just hold the local command ids in an array.
> Execute($_t_CommandName)
> 
> Either way you have to convert from the language you wrote the statement in 
> to an ID and then get the localised name of the command from the ID
> 
> 
> Hope thats enough for you
> 
> Nigel Greenlee
> 
>> On 21 Sep 2017, at 16:34, Paul Lovejoy via 4D_Tech <4d_tech@lists.4d.com> 
>> wrote:
>> 
>> Hi everyone,
>> 
>> I want to use the Execute command in a multi-lingual environment use it to 
>> execute 4D commands such as ARRAY TEXT(). Of course, this would fail as is 
>> on a French version of 4D. I believe there’s a way to use Execute() with the 
>> internal command numbers but I can’t find anything in the docs or the 
>> knowledge base.
>> 
>> Does anyone know how to do this?
>> 
>> Thanks in advance,
>> 
>> 
>> Paul
>> **
>> 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:4d_tech-unsubscr...@lists.4d.com
>> **
> 
> **
> 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:4d_tech-unsubscr...@lists.4d.com
> **

**
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:4d_tech-unsubscr...@lists.4d.com
**

Re: Command numbers and names and using Execute

2017-09-21 Thread Keisuke Miyako via 4D_Tech
ARRAY TEXT is command #222 so you could do

EXECUTE FORMULA(":C222(...)")

C must be uppercase.

c.f.

http://doc.4d.com/4Dv16/4D/16.2/Using-tokens-in-formulas.300-3432926.en.html

> 2017/09/22 0:34、Paul Lovejoy via 4D_Tech <4d_tech@lists.4d.com> のメール:
>
> I want to use the Execute command in a multi-lingual environment use it to 
> execute 4D commands such as ARRAY TEXT(). Of course, this would fail as is on 
> a French version of 4D. I believe there’s a way to use Execute() with the 
> internal command numbers but I can’t find anything in the docs or the 
> knowledge base.
> Does anyone know how to do this?



**
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:4d_tech-unsubscr...@lists.4d.com
**

Re: Command numbers and names and using Execute

2017-09-21 Thread Nigel Greenlee via 4D_Tech
Paul.

When i was writing my rather excellent(even though i say so myself) auto 
variable declaring code I wanted the command and command numbers. I just looked 
up what i did

I ran this bit of code :- 
ARRAY TEXT(SC_at_CommandNames;0)
For ($i;1;1)//well i know there are less than 1 commands for the next 
few years at least:)

  $_t_CommandName:=Command name($i)
If ($_t_CommandName#"")
   APPEND TO ARRAY(SC_at_CommandNames;$_t_CommandName)
End if 
End for 

Now of course you could store the command id ($i) in an array write the 
‘English’ command  name and number to an xml. and when in a French version load 
the ‘French names’ and IDS compare them to the ones in your text and replace 
the english command with the french command or execute the command by ID
storing your text in the following format:


$_t_CommandName:=Get_CommandName($EnglishCommand)<-in which you lookup the ID 
of the command in your xml document(veryfast) and return the ID of that command 
and then get the localised command name

or you could store a version of your text in which the name is replaced with:
$_t_CommandName:=Command name(numberofcommand) when you save the text of your 
execute-in this case you could just hold the local command ids in an array.
Execute($_t_CommandName)

Either way you have to convert from the language you wrote the statement in to 
an ID and then get the localised name of the command from the ID


Hope thats enough for you

Nigel Greenlee

> On 21 Sep 2017, at 16:34, Paul Lovejoy via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> Hi everyone,
> 
> I want to use the Execute command in a multi-lingual environment use it to 
> execute 4D commands such as ARRAY TEXT(). Of course, this would fail as is on 
> a French version of 4D. I believe there’s a way to use Execute() with the 
> internal command numbers but I can’t find anything in the docs or the 
> knowledge base.
> 
> Does anyone know how to do this?
> 
> Thanks in advance,
> 
> 
> Paul
> **
> 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:4d_tech-unsubscr...@lists.4d.com
> **

**
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:4d_tech-unsubscr...@lists.4d.com
**

Command numbers and names and using Execute

2017-09-21 Thread Paul Lovejoy via 4D_Tech
Hi everyone,

I want to use the Execute command in a multi-lingual environment use it to 
execute 4D commands such as ARRAY TEXT(). Of course, this would fail as is on a 
French version of 4D. I believe there’s a way to use Execute() with the 
internal command numbers but I can’t find anything in the docs or the knowledge 
base.

Does anyone know how to do this?

Thanks in advance,


Paul
**
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:4d_tech-unsubscr...@lists.4d.com
**