|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
I'am Relatively New To The Delphi Scene Coming From The VB6 Scene.
Anyway I'am Converting A Few of My VB6 Apps Over To Delphi And I Have Found Myself Stuck. I Need To Know How I Would Go About Implementing The Visual Basic Step Method in Delphi. Example: Code:
For i = 1 to Len(Data$) Step 2 Any Help Would Be Greatly Appreciated. |
|
#2
|
|||
|
|||
|
???
for what purpose do you need it?
|
|
#3
|
|||
|
|||
|
Reply
I need to get the Numeric (Asc) Value of Every Other Character in A String.
ABCDEFGH <- Would Return -> 66, 68, 70, 72 |
|
#4
|
|||
|
|||
|
hmmm
..and what about to divide that even numbers by 2 to discover, which is odd? just use clause in the for statement...
|
|
#5
|
|||
|
|||
|
Reply
I'am Relatively New To The Delphi Scene Coming From The VB6 Scene.
An Example Would Be Very Helpful. ![]() For Instance Its Not About Getting Even And Odd Values, If I Understand You Correctly. If The String is: QnEuFdfvs I Need To Get The Numeric Values Of Every Other Character in The String Starting With n Then, u, d, v Hence Step 2 in VB6. |
|
#6
|
|||
|
|||
|
okay
okay, here is some example code I coded a few moments ago - it's demonstration of Odd() function:
Code:
procedure TForm1.Button1Click(Sender: TObject); var i: integer; begin for i:=0 to 10 do begin if Odd(i) then showmessage(IntToStr(i) + ': is odd') else if not Odd(i) then showmessage(IntToStr(i) + ': is even'); end; end; I think it has to be very simple for you now...you'll just use Odd(i); and thats all and only odd codes will be selected by clause..if I understood you correctly.. ![]() |
|
#7
|
|||
|
|||
|
Thank You Very Much The Odd() Works Beautifully
|
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > Delphi Programming > Need Help..Step |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|