- Strength to Increase Rep
- +0
- Strength to Decrease Rep
- -0
- Upvotes Received
- 1
- Posts with Upvotes
- 1
- Upvoting Members
- 1
- Downvotes Received
- 0
- Posts with Downvotes
- 0
- Downvoting Members
- 0
4 Posted Topics
Their are commercial/delphi solutions to reading GPS input from the USB port but these do maybe 10, 20 or a 100 things whereas I used to read input via the COM port and then do whatever after that. Is there a small (?) piece of delphi (7 or lower) code …
[code] var St,StReverse:String; m,n:Integer; begin St:='I need to reverse this sentence'; StReverse:=''; n:=Length(St)+1; repeat m:=n; repeat dec(n); until (St[n]=' ') or (n=0); StReverse:=StReverse+' '+Copy(St,n+1,m-n-1); until n=0; Label1.Caption:=St+':'+StReverse; end; [/code] You can get the input string/strings from anywhere. This was simply to show you another way!
The most important thing, to my mind in Protaeas's answer is using Int64. You MUST look at the limits of each numeric type. Even LongInt only goes to 10 digits and your Number is 17 digits. I think you should follow that Delphi Help study route on Integer types and …
The question and code don't relate: my posted question is very difficult but I guess I'll just jump in and help where I can! if Pos('11111',Edit.1Text)=0 then Label1.Caption:='No: 11111' else Label1.Caption:='Yes: 11111'; No need for loop, while or repeat until
The End.
tylcoatc