SRL Archive - General

Scar Help needed


endlesslyonline

2011-06-09 04:27:29

Firstly, i just want to say, i did try and Google all these, maybe my Google searching techniques are letting me down, but i really could not fins any answers, that's why i come to you.

OK, Question1:
When i make my scar scrip to create a new INI with help of writeini, i get this:

[example1]
text=one
text=two
[example2]
text=three
text=four

how do i get scar to write a clean line above [example2] and is there a way to get scar to write #comments in the INI ?

so that it looks like this:

[example1]
text=one
text=two

[example2]
text=three
text=four

Question2: message dlg boxes
firstly, how can i center the message box on the form? and secondly, i have a message box with the following text:

this is a bunch of text that is displayed when clicking the button.

but i want it to be like:

this is a bunch of text that
is displayed when clicking the button

how do i get the text split up? i know in vb it is vbCrLf, what do i use in scar?

Question4:
ok, so i want to do the whole shellexecute function to open up notepad from the scar script form, i have done this in scar3.22 and got an error, then i went to settings and turned on API-calls in the settings and it works, now ….
i want to run the same script in scar 3.15, same error, so that means API calls are disabled, but there is no option to enable it in the options?

Question3:
this is not so much a question, more a request for a good tutorial to on how to make a script with multiple forms

Thanks for your time, and hoping to get some help/feedback.

Shuttleu

2011-06-09 04:37:18

Q1) no, but why would you want to?
Q2) i will have a look for you
Q3) use something like this
Procedure StarttScript(Sender: TObject);
begin
{do whatever here}
VineVanquisher.ModalResult:= mrOk; {close current form}
MainInitForm; {load next form}
end;
Q4) absolutely no idea

~shut

Shuttleu

2011-06-09 04:47:09

Q4) go to Script, then click Allow API Calls
Q2) try using Chr(32)

~shut

endlesslyonline

2011-06-09 06:01:03

thanks for the speedy reply,
q1 - i would just like to make the ini a bit neater, but its not a train smash.

on answer to Q2 - char(32)
how would i go about using it? i have tried it in the sense of :
writeln('testing' + char(32) +'testing')

but then i get
Line 756: [Error] (756:28): Type mismatch in script C:\testing_script.scar

sorry, i only see now my formatting was a bit bad on the post, will clean it up a bit.

Shuttleu

2011-06-09 06:12:07

no problem

Chr not Char

if 32 doesnt work try 13

~shut

EDIT: just tried, its Chr(13)

endlesslyonline

2011-06-09 07:00:26

thanks alot again for all the help, dunno what i am doing wrong, here is my script (made in scar 3.15)

*edit* scar seemed to be messing around, i exited and restarted it, and now its working fine, thanks dude

Shuttleu

2011-06-09 07:28:17

odd works fine for me :/

program New;
begin
MessageDlg('You shouldnt be here!' + chr(13) + 'Leave now?', mtWarning, [mbYes,mbNo,mbAbort, mbRetry], 0);
end.

~shut

endlesslyonline

2011-06-09 09:25:37

From: Shuttleu
odd works fine for me :/

program New;
begin
MessageDlg('You shouldnt be here!' + chr(13) + 'Leave now?', mtWarning, [mbYes,mbNo,mbAbort, mbRetry], 0);
end.

~shut


thanks got it working, was messing around in scar 3.15, i downloaded the latest version, peachy now

thanks again for all the help