?
Solved

Help Variable's

Posted on 2001-07-18
11
Medium Priority
?
124 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 2
  • 2
  • +2
11 Comments
 
LVL 11

Accepted Solution

by:
robert_marquardt earned 40 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
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 

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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
Suggested Courses
Course of the Month15 days, 15 hours left to enroll

741 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