Solved

Help Variable's

Posted on 2001-07-18
11
119 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
Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

 

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
 

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

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

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

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…
In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …

774 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