Results 1 to 3 of 3

Thread: Variabele String in variabele string

  1. #1

    Variabele String in variabele string

    Ik heb een code gemaakt om het spel counter strike op te starten. Dit werkt al maar nu wil ik ook nog naar een ip connecte. Nu gebruik ik a om het ip in op te slaan en dan wil ik deze later opslaan in variabele maar daar gaat het niet helemaal goed. Er staat END expected but , found. Hoe kan dit?

    Code:
    procedure TForm3.Button1Click(Sender: TObject);
    var TempString : array[0..79] of char;
        a, c : string;
    begin
      a := Edit1.Text;
      c := 'steam: "-applaunch 10" +connect', a;
      try
        StrPCopy(TempString,c);
        ShellExecute(0, Nil, TempString, Nil, Nil, SW_NORMAL);
      except
    end;
    end;

  2. #2
    De cursor staat voor a in de regel
    Code:
    c := 'steam: "-applaunch 10" +connect', a;
    je moet je string anders opbouwen
    DeX 3 Delphi := The ease of VB with the power of C; Zoekt en gij zult vinden

  3. #3
    .. namelijk door een plus te gebruiken i.p.v. een komma.

    Overigens kun je een string gewoon typecasten naar PChar, ofwel PChar(c) meegeven aan de functie.
    1+1=b

Thread Information

Users Browsing this Thread

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

Bookmarks

Posting Permissions

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