Delphi Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreDelphi Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old June 15th, 2008, 04:34 AM
gh0sTs416 gh0sTs416 is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2008
Posts: 4 gh0sTs416 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 2 m 34 sec
Reputation Power: 0
Unhappy Need Help..Step

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.

Reply With Quote
  #2  
Old June 15th, 2008, 05:28 AM
lukinko_pp lukinko_pp is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2008
Posts: 7 lukinko_pp User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 h 14 m 55 sec
Reputation Power: 0
???

for what purpose do you need it?

Reply With Quote
  #3  
Old June 15th, 2008, 05:36 AM
gh0sTs416 gh0sTs416 is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2008
Posts: 4 gh0sTs416 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 2 m 34 sec
Reputation Power: 0
Reply

I need to get the Numeric (Asc) Value of Every Other Character in A String.

ABCDEFGH <- Would Return -> 66, 68, 70, 72

Reply With Quote
  #4  
Old June 15th, 2008, 05:41 AM
lukinko_pp lukinko_pp is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2008
Posts: 7 lukinko_pp User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 h 14 m 55 sec
Reputation Power: 0
hmmm

..and what about to divide that even numbers by 2 to discover, which is odd? just use clause in the for statement...

Reply With Quote
  #5  
Old June 15th, 2008, 05:43 AM
gh0sTs416 gh0sTs416 is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2008
Posts: 4 gh0sTs416 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 2 m 34 sec
Reputation Power: 0
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.

Reply With Quote
  #6  
Old June 15th, 2008, 05:56 AM
lukinko_pp lukinko_pp is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2008
Posts: 7 lukinko_pp User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 h 14 m 55 sec
Reputation Power: 0
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..

Reply With Quote
  #7  
Old June 15th, 2008, 06:19 AM
gh0sTs416 gh0sTs416 is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2008
Posts: 4 gh0sTs416 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 2 m 34 sec
Reputation Power: 0
Talking Reply

Thank You Very Much The Odd() Works Beautifully

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreDelphi Programming > Need Help..Step


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway
Stay green...Green IT