Results 1 to 23 of 23

Thread: With ... do

  1. #1
    Join Date
    Sep 2006
    Location
    New Jersey, USA
    Posts
    5,347
    Mentioned
    1 Post(s)
    Quoted
    3 Post(s)

    Default With ... do

    Could someone explain why this won't work, and what would need to be done to fix it?

    SCAR Code:
    program New;
    var
      thething: tpoint;
    begin
      with thething do
      begin
        x := 52;
        y := 91;
      end;
    end.

    Code:
    Line 7: [Error] (7:6): Internal error (20) in script
    Interested in C# and Electrical Engineering? This might interest you.

  2. #2
    Join Date
    Feb 2006
    Posts
    433
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    You need a begin after the with..do

  3. #3
    Join Date
    Dec 2006
    Location
    Banville
    Posts
    3,914
    Mentioned
    12 Post(s)
    Quoted
    98 Post(s)

    Default

    Meh, Whats with..do?


    Someone care to explain?
    The jealous temper of mankind, ever more disposed to censure than
    to praise the work of others, has constantly made the pursuit of new
    methods and systems no less perilous than the search after unknown
    lands and seas.

  4. #4
    Join Date
    Dec 2006
    Location
    Houston, TX USA
    Posts
    4,791
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    With can only be used for supported classes.

  5. #5
    Join Date
    Feb 2006
    Posts
    433
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    It should work with all structured types :s

  6. #6
    Join Date
    Dec 2006
    Location
    Banville
    Posts
    3,914
    Mentioned
    12 Post(s)
    Quoted
    98 Post(s)

    Default

    It like sets the variables or something? I'm lost...

    Does it like set the variables for a type (You know... Like TUser), without all of the "TypeName.stuff" stuff?


    Spky, you seem to know what they are...
    The jealous temper of mankind, ever more disposed to censure than
    to praise the work of others, has constantly made the pursuit of new
    methods and systems no less perilous than the search after unknown
    lands and seas.

  7. #7
    Join Date
    May 2007
    Location
    baltimore, md
    Posts
    836
    Mentioned
    0 Post(s)
    Quoted
    8 Post(s)

    Default

    with do usually helps with types in which you have to write out long things. they help because you could do this with forms
    SCAR Code:
    with label1 do
       begin
         caption:='hi'
         height:=29;
       end;
    so basically it lets you not have to put the . in between every variable you just have to do that.

  8. #8
    Join Date
    Dec 2006
    Location
    Banville
    Posts
    3,914
    Mentioned
    12 Post(s)
    Quoted
    98 Post(s)

    Default

    Ahh. Ok.

    Thats what I was pretty sure it did.
    The jealous temper of mankind, ever more disposed to censure than
    to praise the work of others, has constantly made the pursuit of new
    methods and systems no less perilous than the search after unknown
    lands and seas.

  9. #9
    Join Date
    Jun 2007
    Location
    I'm not sure...
    Posts
    581
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Soooooo... Arrays made easy?
    SCAR Code:
    Var i:Array 0..5 of Integer;
    Begin
      With i do
        Begin
          [0]:=7633
          [1]:=57453
          [2]:=346
          [3]:=2346
          [4]:=58576
          [5]:=2435434756
        End;
    End.
    Would that work?
    ---------------------------------------------------------


    Pm me if you need any math functions made. Me = l0ving t3h mathz

    ---------------------------------------------------------

  10. #10
    Join Date
    Dec 2006
    Location
    Banville
    Posts
    3,914
    Mentioned
    12 Post(s)
    Quoted
    98 Post(s)

    Default

    Helpz! I made something like this

    SCAR Code:
    With MainDTMPoint do
     begin;
      x:= 12;
      y:= 14;
     //Area and stuff
     end;

    With DTMSubPoint[0] do
     begin;
      x:= 34;
      y:= 45;  
      //etc.
     end;

    and it doesnt work... It says looking for assignment.

    Sorry for the highjack.

    And, I don't know if it works... Try to compile it.
    The jealous temper of mankind, ever more disposed to censure than
    to praise the work of others, has constantly made the pursuit of new
    methods and systems no less perilous than the search after unknown
    lands and seas.

  11. #11
    Join Date
    Dec 2006
    Location
    utah
    Posts
    1,427
    Mentioned
    2 Post(s)
    Quoted
    7 Post(s)

    Default

    Only Class Types. (In SCAR)
    but TPoint is a recorded type..
    Co Founder of https://www.tagcandy.com

  12. #12
    Join Date
    Sep 2006
    Location
    New Jersey, USA
    Posts
    5,347
    Mentioned
    1 Post(s)
    Quoted
    3 Post(s)

    Default

    Which means...With-do will only work with certain types built into SCAR?
    Interested in C# and Electrical Engineering? This might interest you.

  13. #13
    Join Date
    Dec 2006
    Location
    utah
    Posts
    1,427
    Mentioned
    2 Post(s)
    Quoted
    7 Post(s)

    Default

    Quote Originally Posted by Smartzkid View Post
    Which means...With-do will only work with certain types built into SCAR?
    yeah. Because you cant customize your own In SCAR...



    im pretty sure in delphi your able to use "With" on recorded types though.
    Co Founder of https://www.tagcandy.com

  14. #14
    Join Date
    Dec 2006
    Location
    Houston, TX USA
    Posts
    4,791
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    I'm pretty sure I said "With can only be used for supported classes." about 9 posts ago...

  15. #15
    Join Date
    Nov 2006
    Location
    NSW, Australia
    Posts
    3,487
    Mentioned
    1 Post(s)
    Quoted
    0 Post(s)

    Default

    Haha.

    All this talk of supported/class or whatever crap you developers or to-be-developers are talking about is a bit brain freezing...
    [CENTER][img]http://signatures.mylivesignature.com/54486/113/4539C8FAAF3EAB109A3CC1811EF0941B.png[/img][/CENTER]
    [CENTER][BANANA]TSN ~ Vacation! ~ says :I Love Santy[/BANANA][/CENTER]

    [CENTER][BANANA]Raymond - Oh rilie? says :Your smart[/BANANA][/CENTER]

  16. #16
    Join Date
    Nov 2006
    Posts
    1,103
    Mentioned
    0 Post(s)
    Quoted
    6 Post(s)

    Default

    but if you would import it via a plugin, would it then work?
    Infractions, reputation, reflection, the dark side of scripting, they are.

  17. #17
    Join Date
    Dec 2006
    Location
    utah
    Posts
    1,427
    Mentioned
    2 Post(s)
    Quoted
    7 Post(s)

    Default

    Quote Originally Posted by iloveit8 View Post
    but if you would import it via a plugin, would it then work?
    Im Sure if you made a class type in a plugin, it could work (dont know)
    Co Founder of https://www.tagcandy.com

  18. #18
    Join Date
    Oct 2006
    Location
    Ireland
    Posts
    855
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by SantaClause View Post
    Haha.

    All this talk of supported/class or whatever crap you developers or to-be-developers are talking about is a bit brain freezing...
    It means you can only do it with variable types built into scar. Tpoints arnt built into scar

  19. #19
    Join Date
    May 2007
    Location
    baltimore, md
    Posts
    836
    Mentioned
    0 Post(s)
    Quoted
    8 Post(s)

    Default

    Then where are Tpoints i thought they were built into scar.

  20. #20
    Join Date
    Dec 2006
    Location
    Houston, TX USA
    Posts
    4,791
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    No, please, you don't know what your talking about.

    With only works for class, it doesn't have to do with anything else.

  21. #21
    Join Date
    Dec 2006
    Location
    utah
    Posts
    1,427
    Mentioned
    2 Post(s)
    Quoted
    7 Post(s)

    Default

    Gah. somthing class would look like this

    SCAR Code:
    type
      TSomthing = class
     class function GetVersion : string;

    end;


    class function TSomthing.GetVersion: string;
    begin
      result := 'V 1.3';
    end;

    and recorded types are

    SCAR Code:
    type = record
      x, y : Integer;
     end;
    Co Founder of https://www.tagcandy.com

  22. #22
    Join Date
    Nov 2006
    Location
    NSW, Australia
    Posts
    3,487
    Mentioned
    1 Post(s)
    Quoted
    0 Post(s)

    Default

    Whatever dude.

    Icefire, no offence, but that was a bit arrogant don't you think?
    [CENTER][img]http://signatures.mylivesignature.com/54486/113/4539C8FAAF3EAB109A3CC1811EF0941B.png[/img][/CENTER]
    [CENTER][BANANA]TSN ~ Vacation! ~ says :I Love Santy[/BANANA][/CENTER]

    [CENTER][BANANA]Raymond - Oh rilie? says :Your smart[/BANANA][/CENTER]

  23. #23
    Join Date
    Sep 2006
    Location
    New Jersey, USA
    Posts
    5,347
    Mentioned
    1 Post(s)
    Quoted
    3 Post(s)

    Default

    Nah, he's just annoyed 'cause we're too stupid to listen

    Sky and Ice, thanks.
    Interested in C# and Electrical Engineering? This might interest you.

Thread Information

Users Browsing this Thread

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

Posting Permissions

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