|
3 registered members (Quad, TipmyPip, 1 invisible),
2,064
guests, and 3
spiders. |
|
Key:
Admin,
Global Mod,
Mod
|
|
|
Re: passing a string in from the command line
[Re: MrCode]
#128786
05/09/07 03:04
05/09/07 03:04
|
Joined: Oct 2003
Posts: 702
zazang
User
|
User
Joined: Oct 2003
Posts: 702
|
I dunno if strings work and from the manual it seems it can take integer/float values only.So you could try :-
-d var1
...
IFDEF var1; { str_cpy(my_str,"foobar"); }
I haven't tried it,but let me know if it works ! Secondly,how can a value given by -d be directly accesed via C-script ?
I like good 'views' because they have no 'strings' attached..
|
|
|
Re: passing a string in from the command line
[Re: zazang]
#128789
05/09/07 16:46
05/09/07 16:46
|
Joined: Jan 2002
Posts: 4,225 Germany / Essen
Uhrwerk
Expert
|
Expert
Joined: Jan 2002
Posts: 4,225
Germany / Essen
|
In general you could pass arbitrary things to trough the command line by passing c-script instructions and then executing via the "execute" instruction at the beginning of your main function. You could then pass "str_cpy(MyString,"Hello World!")" to the command line and that would initialize the string MyString with "Hello World!".
Always learn from history, to be sure you make the same mistakes again...
|
|
|
Re: passing a string in from the command line
[Re: MrCode]
#128791
05/09/07 23:25
05/09/07 23:25
|
Joined: Jan 2002
Posts: 4,225 Germany / Essen
Uhrwerk
Expert
|
Expert
Joined: Jan 2002
Posts: 4,225
Germany / Essen
|
No, it isn't. Your solution is fixed to strings while the method I suggested would allow to execute arbitrary code.
Always learn from history, to be sure you make the same mistakes again...
|
|
|
|