Solved

Help Variable's

Posted on 2001-07-18
11
118 Views
Last Modified: 2010-04-06
Example:
I have the following thing:
c1: = 'data';
c2: = 'data';
c3: = 'data';
c4: = 'data';
c5: = 'data';

that routine I can use to concatenate these fields within a for or while. s1: = s1 + c?

Greetings Ruben  
0
Comment
Question by:rbarzallo
  • 4
  • 2
  • 2
  • +2
11 Comments
 
LVL 11

Accepted Solution

by:
robert_marquardt earned 10 total points
ID: 6295378
As in most other programming languages you cannot iterate over separate variables.

do something like

var
  C: array [1..5] of string;
  I: Integer;
  S: string;
begin
  C[1] := 'data1';
  C[2] := 'data2';
  C[3] := 'data3';
  C[4] := 'data4';
  C[5] := 'data5';
  S := '';
  for I := Low(C) to High(C) do
    S := S + C[I];
end;
0
 
LVL 4

Expert Comment

by:YodaMage
ID: 6295733
You have to use a pointer "^" in order to achieve this.
0
 

Author Comment

by:rbarzallo
ID: 6295976
ok,
entonces no puedo realizar como en visual basic :

  s1 := s1 + c&number


ruben
0
 

Author Comment

by:rbarzallo
ID: 6295978
ok,
then I cannot make like in visual BASIC:
     s1: = s1 + c&number  

Ruben
0
 
LVL 4

Expert Comment

by:YodaMage
ID: 6295998
Nope
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

Author Comment

by:rbarzallo
ID: 6296043
by I complete,
c1: = 'data';

 Assuming this:
s2: = ' c1 ';
s1: = like knowing the content of c1 if this within s2??????  
Ruben
0
 

Author Comment

by:rbarzallo
ID: 6296047
that it means "nope"?  
 
0
 
LVL 11

Expert Comment

by:robert_marquardt
ID: 6296874
yodaMage, even using pointers may not york.
Nothing hinders the compiler to use a register for some of the variables.
0
 
LVL 2

Expert Comment

by:Felixin
ID: 6298209
Nope = no

Simplemente no puedes hacerlo porque el Delphi es un lenguaje estructurado que no esta pensado para eso. Lo que te plantean son alternativas: utilizar punteros, poner las variables en arrays.

Tanslation:

Nope=no (that was obvious ;-))

Simply you cannot make it because Delphi is a structurec languaje non thought for that. What they are giving to you are work arrounds: pointers, put the variables in arrays ...

Think that in Basic you can do many things that you can't in structured languajes. That's because you can mess up Basic code so easily if you're not very organized.

0
 
LVL 26

Expert Comment

by:Russell Libby
ID: 8703560
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:

Accept robert_marquardt's comment as answer

Please leave any comments here within the next seven days.
 
PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!
 
Thank you,
Russell

EE Cleanup Volunteer
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.

864 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now