Can i put a default answer into a readln so that if the user wanted to use the same thing most of the time they wouldn't have to keep reentering it? (they would still be able to edit the text and put a new answer if needed)
![]()
Can i put a default answer into a readln so that if the user wanted to use the same thing most of the time they wouldn't have to keep reentering it? (they would still be able to edit the text and put a new answer if needed)
![]()
I don't think so.. But you could make your own readln function with your own form
don't be intimidated by the form, I never knew forms until recently and it's really quick and easy to learn once you try. Just learn how to make a form all you need is a TEdit, TLabel, and TButton, 3 simple things to do that.Good luck if you decide to learn this, I hope you do as it's quite easy and not that time consuming to learn, but if you really can't/won't make it on your own then I could help you out probably.
You sure can.
If you wanted to save it for the next time it's opened, you can use the WriteINI function. I'm not sure if there's a better way, but that's how I know how to do it.SCAR Code:TEdit.Text := 'Default text here';
Last edited by Coh3n; 02-17-2010 at 04:45 AM.
SRL's F.A.Q. (Error fixes) | How to Convert SRL-5 Scripts to SRL-6 | Draynor Chop N' Bank (RS3)| AIO Superheater (RS3)
T - E - A - MTogether Everyone Achieves More
yea, but that's for a form Coh3n, he's talking bout ReadLn();, which I don't think you can edit the text, I think you need to make your own form and add in the default text since ReadLn doesn't have default text.
SRL's F.A.Q. (Error fixes) | How to Convert SRL-5 Scripts to SRL-6 | Draynor Chop N' Bank (RS3)| AIO Superheater (RS3)
T - E - A - MTogether Everyone Achieves More
He wants the Readln to have default text in the box, but since Readln is a form "in" the function in scar, you can't edit it to put in TEdit.Text as far as I know, at least not without recreating the form, which would be quite simple since it's only a TButton, TEdit, and TLabel, and then he could just add into the TEdit a text.
SCAR Code:var
s, TheVariableYouWant: string;
begin
s := ReadINI('parameterthings here');
if s <> '' then
begin
writeLn('Some settings are saved already');
TheVariableYouWant := s;
end else
begin
writeLn('Settings are empty, asking them now');
TheVariableYouWant := ReadLn('Say something noob');
WriteINI('parameterthings', TheVariableYouWant);
end;
end;
There are currently 1 users browsing this thread. (0 members and 1 guests)