Autor Beitrag
JeanvanHees
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 146

win 2000
D6 Pers
BeitragVerfasst: Mi 25.09.02 15:44 
:wink2: Tag leute,

dies ist meinen code:
ausblenden Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
function Parread(nextst:string;VMnpos,AMnpos:integer;sm:boolean):integer;
var
return:integer;
lineM,dummynm:string;
parmet:array of real;
dum1,dum2:boolean;
begin
if nextst = 'V'
        then begin
        return:=Getpos(Episodestring,VMnpos,chr(13));
        lineM:=copy(Episodestring,VMnpos,return-VMnpos);
        Getparams(lineM,parmet,dummynm,dum1,dum2);
        if sm
                then Parread:=trunc(parmet[1])
                else Parread:=trunc(parmet[2]);
        end
        else begin
        return:=Getpos(Episodestring,AMnpos,chr(13));
        lineM:=copy(Episodestring,AMnpos,return-AMnpos);
        Getparams(lineM,parmet,dummynm,dum1,dum2);
        if sm
                then Parread:=trunc(parmet[1])
                else Parread:=trunc(parmet[2]);
        end;
end;

Bei Getparams bekomme ich einen error weil lineM nicht stimmt, wenn ich einen break VOR lineM:= setze bekomme ich beim runnen noch immer den error....Es sieht so aus alsob der break übersprungen wird :eyes:

Hat jemand ne idee???

_________________
Cause even though I know things won't get any better, they can certainly never get much worse!
Tino
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Veteran
Beiträge: 9839
Erhaltene Danke: 45

Windows 8.1
Delphi XE4
BeitragVerfasst: Mi 25.09.02 16:15 
Wo hin sollte denn Deiner Meinung nach gesprungen werden wenn Du "break" benutzt?

Hier mal ein (sehr) kurzer Satt aus der Delphi Hilfe:
Delphi-Hilfe hat folgendes geschrieben:
Die Prozedur Break verläßt eine for-, while- oder repeat-Schleife.

Also wird das wohl in der If-Then-Anweisung nicht funktionieren.

Gruß
TINO
DeCodeGuru
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 1333
Erhaltene Danke: 1

Arch Linux
Eclipse
BeitragVerfasst: Mi 25.09.02 16:19 
wenn du die Prozedur unterbrechen willst, kannst du das mit exit; machen

_________________
Viele Grüße
Jakob
Udontknow
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 2596

Win7
D2006 WIN32, .NET (C#)
BeitragVerfasst: Mi 25.09.02 16:33 
Ich glaube, es ist nicht ganz klar, was du meinst.

Meinst du break wie Zeilenumbruch in einem String, oder den Befehl "break"? Oder meinst du etwa einen Breakpoint? Wenn ja, bei welchem LineM setzt du ihn (du hast da schliesslich 2mal Linem:=...)?
Was für einen Error bekommst du? Einen Kompilierungsfehler? Wie lautet der? Was für eine Fehlermeldung (Zitat!) kommt zur Laufzeit?

Cu,
Udontknow
JeanvanHees Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 146

win 2000
D6 Pers
BeitragVerfasst: Mi 25.09.02 16:53 
Ich meine ein breakpoint...
Entschuldige für die schlechte information von mir.
Also ein breakpoint was ich setze funktioniert nicht :(
Der error geht viel zu weit zurück in meinen code um hier sehen zu lassen.
Aber es geht nicht um die meldung, sondern um das breakpoint.

_________________
Cause even though I know things won't get any better, they can certainly never get much worse!
Udontknow
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 2596

Win7
D2006 WIN32, .NET (C#)
BeitragVerfasst: Mi 25.09.02 16:56 
Aha. Wie lautet denn der Fehler?
Motzi
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 2931

XP Prof, Vista Business
D6, D2k5-D2k7 je Prof
BeitragVerfasst: Mi 25.09.02 17:06 
Das Problem hatte ich auch schon mal, hab dann was im Netz darüber gefunden. Das Problem tritt auf wenn irgendwelche Sonderzeichen im Code sind die der Editor nicht anzeigt (kann vorkommen wenn man irgendeinen Code aus dem Browser per Copy&Paste einfügt). Das Problem lässt sich aber ganz einfach lösen:

MS-DOS Eingabeaufforderung
edit <Pfad zu deiner .pas-Datei>
einfach nur speichern

und die Sache ist erledigt!

_________________
gringo pussy cats - eef i see you i will pull your tail out by eets roots!
JeanvanHees Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 146

win 2000
D6 Pers
BeitragVerfasst: Do 26.09.02 08:34 
Ok, wirds mal versuchen...
Der error war übrigens..." is not a valid integer value.
und das war weil ich einen integer aus den string holen muß und der string ist noch leer...aber das wird ich selbst schon finden...wenn ich wieder einen break setzen kann.

_________________
Cause even though I know things won't get any better, they can certainly never get much worse!
JeanvanHees Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 146

win 2000
D6 Pers
BeitragVerfasst: Do 26.09.02 08:50 
Habs versucht; hat nicht funktioniert :cry:
Ich glaube es hat etwas zu tun mit eine shell function die ich gebrauche.
Ich hatte schon eher probleme damit das ich den shell nicht erst zu ende kann laufen lassen....Also hab ich gesucht und diese procedure aufs internet gefunden.
ausblenden volle Höhe Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
////////////////////////////////////////////////////////////////
// AppName:  name (including path) of the application
// AppArgs:  command line arguments
// Wait:     0 = don't wait on application
//           >0 = wait until application has finished (maximum in milliseconds)
//           <0 = wait until application has started (maximum in milliseconds)
// Hide:     True = application runs invisible in the background
// ExitCode: exitcode of the application (only avaiable if Wait <> 0)
//
function STO_ShellExecute(const AppName, AppArgs: String; const Wait: Integer;
  const Hide: Boolean; var ExitCode: DWORD): Boolean;
var
  myStartupInfo: TStartupInfo;
  myProcessInfo: TProcessInformation;
  sAppName: String;
  iWaitRes: Integer;
begin
  // initialize the startupinfo
  FillChar(myStartupInfo, SizeOf(TStartupInfo), 0);
  myStartupInfo.cb := Sizeof(TStartupInfo);
  myStartupInfo.dwFlags := STARTF_USESHOWWINDOW;
  if Hide then // hide application
    myStartupInfo.wShowWindow := SW_HIDE
  else // show application
    myStartupInfo.wShowWindow := SW_SHOWNORMAL;

  // prepare applicationname
  sAppName := AppName;
  if (Length(sAppName) > 0) and (sAppName[1] <> '"') then
    sAppName := '"' + sAppName + '"';

  // start process
  ExitCode := 0;
  Result := CreateProcess(nil, PChar(sAppName + ' ' + AppArgs), nil, nil, False,
              NORMAL_PRIORITY_CLASS, nil, PChar(ExtractFilePath(AppName)),
              myStartupInfo, myProcessInfo);

  // could process be started ?
  if Result then
  begin
    // wait on process ?
    if (Wait <> 0) then
    begin
      if (Wait > 0) then // wait until process terminates
        iWaitRes := WaitForSingleObject(myProcessInfo.hProcess, Wait)
      else // wait until process has been started
        iWaitRes := WaitForInputIdle(myProcessInfo.hProcess, Abs(Wait));
      // timeout reached ?
      if iWaitRes = WAIT_TIMEOUT then
      begin
        Result := False;
        TerminateProcess(myProcessInfo.hProcess, 1);
      end;
      // getexitcode
      GetExitCodeProcess(myProcessInfo.hProcess, ExitCode);
    end;
    CloseHandle(myProcessInfo.hProcess);
  end;
end;


Nett; Es hat ja mich auch von viele probleme erlöst.
Aber es gibt noch immer situationen die mich an die stabilität zweifeln lassen. Wie mit den breakpoint :crying:

_________________
Cause even though I know things won't get any better, they can certainly never get much worse!
JeanvanHees Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 146

win 2000
D6 Pers
BeitragVerfasst: Do 26.09.02 09:10 
Ok, entschuldigung, den trick mit den edit hat doch funktioniert...
Danke danke!!! :D
Aber wenn ihr etwas sieht in die procedur was ich nicht sehe wird das mir auch weiterhelfen weil ich wie gesagt manchmal probleme damit entdecke.

_________________
Cause even though I know things won't get any better, they can certainly never get much worse!