Results 1 to 3 of 3

Thread: Forms problem!! (color pciker involved)

  1. #1
    Join Date
    Jul 2008
    Posts
    31
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Forms problem!! (color pciker involved)

    Solved!

  2. #2
    Join Date
    Dec 2006
    Location
    Sydney, New South Wales, Australia
    Posts
    4,603
    Mentioned
    15 Post(s)
    Quoted
    42 Post(s)

    Default

    Well, the first error i had spotted was this:
    Code:
    [Runtime Error] : Exception: Unknown procedure in line 120 in script
    That obviously tells us that a procedure has been called, but it's unknown. This is the line:
    SCAR Code:
    ThreadSafeCall('InitForm', v);
    There is no InitForm in your script. It is replaced by the procedure form. So change that to 'form' and you'll be off this error.

    That's all the errors from your script.

    As for your second question, the reason that is because a string cannot be called as an integer. Since edit1.text is a string and f and 0 is an integer. Read up on tutorials about the differences between them two

    Good luck. Any more help needed? Please post
    You may contact me with any concerns you have.
    Are you a victim of harassment? Please notify me or any other staff member.

    | SRL Community Rules | SRL Live Help & Chat | Setting up Simba | F.A.Q's |

  3. #3
    Join Date
    Jul 2008
    Posts
    31
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    I have solved my problem by using a function that makes a string into a integer if you plan on doing an example use this also copy my owl script on the form may help clear it out for noobies:
    SCAR Code:
    program Copperminerdelux;
    {.include SRL\SRL.scar}
    var
    frmdesign : tform;
    loads : tlabel;
    edit1 : tedit;
    button1 : tbutton;
    loadn : String;
    I, u, g, f, abc: integer;

    procedure ButtonClick(sender: TObject);
    begin
      frmDesign.Caption:= frmDesign.Caption + '.';
      frmDesign.ModalResult:=MrOk;
    end;

    procedure initform;
    begin
    frmdesign := createform;
    frmdesign.left := 459;
    frmdesign.top := 270;
    frmdesign.width := 274;
    frmdesign.height := 292;
    frmdesign.caption := 'choose loads #';
    frmdesign.color := clbtnface;
    frmdesign.font.color := clwindowtext;
    frmdesign.font.height := 30;
    frmdesign.font.name := '@batang';
    frmdesign.font.style := [];
    frmdesign.visible := false;
    frmdesign.pixelsperinch := 96;
    loads := tlabel.create(frmdesign);
    loads.parent := frmdesign;
    loads.left := 0;
    loads.top := 40;
    loads.width := 257;
    loads.height := 30;
    loads.caption := 'Loads TO DO:';
    edit1 := tedit.create(frmdesign);
    edit1.parent := frmdesign;
    edit1.left := 0;
    edit1.top := 80;
    edit1.width := 257;
    edit1.height := 26;
    edit1.font.color := clwindowtext;
    edit1.font.height := 18;
    edit1.font.name := '@batang';
    edit1.font.style := [];
    edit1.parentfont := false;
    edit1.taborder := 8;
    edit1.text := 'Click and type # of loads!';
    Button1 := tbutton.create(frmdesign);
    button1.parent := frmdesign;
    button1.onclick := @buttonclick;
    button1.left := 40;
    button1.top := 144;
    button1.width := 161;
    button1.height := 97;
    button1.caption := 'Start';
    button1.taborder := 9;
    end;

    procedure SafeInitForm;
    var
      v: TVariantArray;
    begin
      setarraylength(V, 0);
      ThreadSafeCall('InitForm', v);
    end;

    procedure ShowFormModal;
    begin
      frmdesign.ShowModal;
    end;

    procedure SafeShowFormModal;
    var
      v: TVariantArray;
    begin
      setarraylength(V, 0);
      ThreadSafeCall('ShowFormModal', v);
    end;

    begin
     SafeInitForm;
         SafeShowFormModal;
    repeat
    cleardebug;
    I := I + 1;
    u := u + 28;
    g := g + 17;
    f := f + 1;
    Writeln('Sink998'#39's Copperminer report');
    Writeln('Script has been running ' + timerunning);
    Writeln('You have done ' + IntToStr(I) + ' Loads');
    Writeln('you have mined ' + IntToStr(u) + ' copper ore');
    Writeln('you have erened ' + IntToStr(g) + ' expirience points note this is estimated add 14 expirience to every load to know accurate results');
    Writeln('_________________________________________');
    Writeln('|                SINK                   |');
    writeln(' \              998                    / ');
    writeln('-----------------------------------------');
    abc := strtoint(edit1.text)
    until (f >= 0 + abc);
    end.

    please test out my form and tell em how iam going about it so far

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. problem with color tool
    By hoo in forum News and General
    Replies: 0
    Last Post: 11-08-2007, 12:02 PM
  2. color picker button in forms?
    By RudeBoiAlex in forum OSR Help
    Replies: 4
    Last Post: 10-25-2007, 07:39 PM
  3. Problem With Forms
    By Emagdnim in forum OSR Help
    Replies: 3
    Last Post: 09-04-2007, 03:54 AM
  4. I need help with a color problem
    By syther fox in forum OSR Help
    Replies: 3
    Last Post: 07-19-2007, 04:40 PM
  5. Problem with desert color
    By Kingofptw in forum OSR Help
    Replies: 18
    Last Post: 03-26-2007, 09:48 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •