Gamestudio Links
Zorro Links
Newest Posts
lookback setting performance issue
by 7th_zorro. 04/16/24 03:08
folder management functions
by 7th_zorro. 04/15/24 10:10
zorro 64bit command line support
by 7th_zorro. 04/15/24 09:36
Zorro FIX plugin - Experimental
by flink. 04/14/24 07:48
Zorro FIX plugin - Experimental
by flink. 04/14/24 07:46
LPDIRECT3DCUBETEXTUR
E9

by Ayumi. 04/12/24 11:00
Sam Foster Sound | Experienced Game Composer for Hire
by titanicpiano14. 04/11/24 14:56
SGT_FW
by Aku_Aku. 04/10/24 16:09
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (7th_zorro, Quad), 373 guests, and 3 spiders.
Key: Admin, Global Mod, Mod
Newest Members
11honza11, ccorrea, sakolin, rajesh7827, juergen_wue
19045 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
script() function that sets Script #477654
07/19/19 18:55
07/19/19 18:55
Joined: Feb 2017
Posts: 1,724
Chicago
AndrewAMD Offline OP
Serious User
AndrewAMD  Offline OP
Serious User

Joined: Feb 2017
Posts: 1,724
Chicago
jcl,

It would be handy if there was a function script() that sets Script, much like algo() sets Algo.

I have an application where I am producing a lot of log files in a batch-heavy setup, with many unique command line options. It would be useful if I can supply strf() as an input.

Thanks,
Andrew

EDIT: In retrospect, it looks like Script has no effect on the name of log files, but only LogNumber does. Nonetheless, I do need to change Script when I have multiple live zorros running the same script.

Last edited by AndrewAMD; 07/20/19 17:36.
Re: script() function that sets Script [Re: AndrewAMD] #477657
07/19/19 21:44
07/19/19 21:44
Joined: Sep 2003
Posts: 929
Spirit Offline

Moderator
Spirit  Offline

Moderator

Joined: Sep 2003
Posts: 929
Why not script(string s) { Script = s; } ?

Re: script() function that sets Script [Re: AndrewAMD] #477659
07/20/19 02:12
07/20/19 02:12
Joined: Feb 2017
Posts: 1,724
Chicago
AndrewAMD Offline OP
Serious User
AndrewAMD  Offline OP
Serious User

Joined: Feb 2017
Posts: 1,724
Chicago
Wouldn’t that cause undefined behavior?

For example, strf outputs a temporary pointer.

Re: script() function that sets Script [Re: AndrewAMD] #477661
07/20/19 05:47
07/20/19 05:47
Joined: Sep 2003
Posts: 929
Spirit Offline

Moderator
Spirit  Offline

Moderator

Joined: Sep 2003
Posts: 929
Youre right, but what about this

void script(string s) { static char S[50]; strcpy(S,s); Script = S; }

Re: script() function that sets Script [Re: AndrewAMD] #477667
07/20/19 14:18
07/20/19 14:18
Joined: Feb 2017
Posts: 1,724
Chicago
AndrewAMD Offline OP
Serious User
AndrewAMD  Offline OP
Serious User

Joined: Feb 2017
Posts: 1,724
Chicago
This works, thanks.

I think the newbies might appreciate a permanent implementation of this. (Rookie mistake: Script = strf(....))

Re: script() function that sets Script [Re: AndrewAMD] #477696
07/22/19 05:50
07/22/19 05:50
Joined: Jul 2000
Posts: 27,978
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,978
Frankfurt
We would then need such functions for all the predefined strings. But I'll put a remark in the manual for this case.

Re: script() function that sets Script [Re: AndrewAMD] #477701
07/22/19 13:28
07/22/19 13:28
Joined: Feb 2017
Posts: 1,724
Chicago
AndrewAMD Offline OP
Serious User
AndrewAMD  Offline OP
Serious User

Joined: Feb 2017
Posts: 1,724
Chicago
Makes sense, thanks.


Moderated by  Petra 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1