View Full Version : Need few examples about new girder commands please.
Ron
October 13th, 2002, 12:55 PM
Explicit return is a little tricky do you understand the way that Girder walks over the tree triggering commands ? Well if you jump to a multicommand you can stop the processing of the 1 multicommand by using explicit return. The main processing will go on however. Not clear ? (probably :wink: just put 2 commands in a multi command, the first is the explicit return, the second the osd or something just to see if it executes. Now run ( f5) this multicommand, you'll see that it never reaches the osd thing.
Get Tick count, retrieves the time in milliseconds that have passesed since windows started. The reset tick count resets this counter to zero.
numbuilder has an example in the help directory. Look at that.
Ron
October 13th, 2002, 12:55 PM
The jumps within Girder all wait for the other multi command to finish so that is not a problem.
Online numbuilder docs ? Where :smile:
Ron
October 13th, 2002, 12:55 PM
Aaah not numbuilder but numparser,.. well that was the first name for it, its Girder Variable Manipulation Script (GVMS) now.
Glad you like it, the substr function will be implemented in Girder 3.1.0 (FINAL!) and will be out either today or tomorrow.
Tables (arrays) will not yet be possible. But I'll look into how to go about implementing them.
-Ron
Ron
October 13th, 2002, 12:55 PM
Many hours of programming :smile:
Btw, substr has been implemented and works.
Ron
October 13th, 2002, 12:55 PM
Hex literals and strtoint support,.. let me see. In C the only function that actually converts a string (with a hex number in it) to an integer is scanf, right ?
Ron
October 13th, 2002, 12:55 PM
Okay added GVMS now recognises 0xFF formed hexadecimal numbers.
Ron
October 13th, 2002, 12:55 PM
Use strlen("OK"); I see that I forgot to put that in the documentation, but it is in there.
-Ron
Mark F
October 13th, 2002, 12:55 PM
WOW! KUDOS! This is really close to exactly what I need! :smile:
I may have missed it but I've read the help and can't find something to convert strings that represent hex numbers into integer variables.
Unfortunately, the serial plugin translates all incoming binary data into strings of hex bytes. I'd like to place some of these received bytes into int-type variables to do bit testing and other value comparisons.
I've tried -
int d;
string str;
str = 0x4f;
d = strtoint(str);
// d = 0
str = 4f;
d = strtoint(str);
// d = 4
str = 4fh;
d = strtoint(str);
// d = 4
I'm looking for something that makes d = 79. For that matter, if I'm going to ask for the world, I'd like to use hexidecimal notation in literals, too. :wink: This would make it easier to test values against bit masks (d&0x80 instead of d&128). Any chance of getting more hex (or non-decimal) number support in the future?
Thanks for the great update! :smile:
Mark F
October 13th, 2002, 12:55 PM
Hex literals and strtoint support,.. let me see. In C the only function that actually converts a string (with a hex number in it) to an integer is scanf, right ?
That is the one I've always used. :smile:
Thanks, again.
giova
October 13th, 2002, 12:55 PM
Hi.
I got few problem to understand excatly the meaning of few new Girger commands.
May someone give me few examples to show me how does those commands works, and help me to understand what they are exactky supposed to do :
-Explicit Return
-Variable String manipulation (very important for me)
-Get Tick count & Reset Tick count
And about NumBuilder PLuggin too if possible :smile:
Thank u very much by advance for anything that u can bring me to help me. :smile:
giova
October 13th, 2002, 12:55 PM
Thank you very much for ur help Ron.
Ur explains helped me, and made me think to something:
May we have a "Call" command that wait for end process of the multigroup called?
Is there a way to know if a multigroup still processing? (to help us to prevent no-end call, or no-end AlarmTimer loop)
Of course we can use a reg that we put to 1 at the beginning of the multigroup, then set to 0 a the end of the multigroup, to know when the multigeroup process end. But thinks would become complicated, if we want to manage many multigroup processes.
Now i gonna read carrefully ur online help document about Num Parser :smile:
Thanks again
<font size=-1>[ This Message was edited by: giova on 2002-03-29 15:44 ]</font>
<font size=-1>[ This Message was edited by: giova on 2002-03-29 16:19 ]</font>
giova
October 13th, 2002, 12:55 PM
Ok i've read the num parser doc.
This really a great feature that open us a nice horizon.
Once again i have a request :
Is it possible to have a function, that return the position of a substring ?
example, let s call that subsrt() :
toto = substr("girder is great","r",0);
// toto = 3
toto = substr("girder is great","r",1);
// toto = 6
toto = substr("girder is great","r",2);
// toto = 12
toto = substr("girder is great","is",0);
// toto = 8
toto = substr("girder is great","as",0);
// toto = -1
//-1 would means no hit
With this function and other allready present, we would be able (for example)to retrieve a path, cut a part of it, remplace this part by an other...etc...
we also could simulate tables
example :
toto=['chair','tree','home'];
i=0
selectIn=substr(toto,"'",i);
selectOut=substr(toto,"'",i+1);
FirstWord=cut(toto,selectIn+1,selectOut-1);
//FirstWord would be : "chair"
i=1
selectIn=substr(toto,"'",i);
selectOut=substr(toto,"'",i+1);
SecondWord=cut(toto,selectIn+1,selectOut-1);
//SecondWord would be : "tree"
etc...
<font size=-1>[ This Message was edited by: giova on 2002-03-29 16:19 ]</font>
giova
October 13th, 2002, 12:55 PM
i was meaning num parser, sorry.
i've corrected the mistake :smile:
giova
October 13th, 2002, 12:55 PM
Really great !!! :grin:
how do u do to make a so good job?
giova
October 13th, 2002, 12:55 PM
On 2002-03-29 19:01, RonB wrote:
Hex literals and strtoint support,.. let me see. In C the only function that actually converts a string (with a hex number in it) to an integer is scanf, right ?
Sorry, but i don't know, i'm a programmer, not a developper :-/
SouthyPar
October 13th, 2002, 12:55 PM
Okay I'm a little way out of my league programming-wise (I'm a budding Visual-Basic artist :wink: ) so please excuse any dopey mistakes I make.
What about the function
Len("ok")
// which would return the int '2'?
This would make up for the lack of Left() and Right() string manipulation functions (which aren't really needed once you have both Cut and Len).
rdmears
October 13th, 2002, 12:55 PM
Although you can't covert the hexcode input from the UIR driver directly with strtoint() and there is no hextoint() function, I discovered this workaround after Ron added 0xFF number recognition:
keycode = strtoint( "0x"+[pld1] );
Now you have the hex string converted to integer!
Powered by vBulletin® Version 4.1.8 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.