[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

ARRAY AND STRINGGRID

Posted on 2003-10-31
3
Medium Priority
?
702 Views
Last Modified: 2010-04-05
I have array of integer (72row  3col)...
I have stringgrid(11row 3col)...
Now I want from array to read each grid1[0,grdrow] and
put the value of myarray[aryrow,3] in grid1[1,grdrow]...
I  try this code but no action:-

//******************************************

  listR220(myarray);          //display the value of array

    for grdrow:= 1 to Grid1.RowCount -1 do
         for aryrow := 1 to 72 do
         begin
            if strToint(Grid1.cells[0,grdrow])=myarray[aryrow,3] then
               begin
               Grid1.cells[1,grdrow]:=inttostr( myarray[aryrow,3]);
               end;
          end;
0
Comment
Question by:sal1150
[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
  • 2
3 Comments
 
LVL 17

Accepted Solution

by:
geobul earned 540 total points
ID: 9661388
Hi,

I can't get what you are doing but obviously the condition is evaluating to false every time:
    if strToint(Grid1.cells[0,grdrow])=myarray[aryrow,3] then

i.e. there is no match between these two integers in your data. To make yourself sure that the code is doing what you want:
1. clear all grid cells in the second column (index 1) ;
2. enter at least one value from myarray(?,3) in one grid cell (first column - index 0);
3. run the code above again and that value from 2. has to appear in grid column 2.

Regards, Geo
0
 

Author Comment

by:sal1150
ID: 9662242
Hi geobul
Before I am asking I do same your steps but no it is not working!
So is there any solution

1-my data store in array
2-I enter some value in col 0 in grid1
3-I want to fill col 1 in grid1 from array
4-If grid1.cell[0,row] = myarray(?,3) then write equivlant value in col 1
0
 

Author Comment

by:sal1150
ID: 9662268
Hi geobul
It is true ,there is no match between these two integers in my data...

I must combare between firs col of grid and first col of array and put the value of third col of array in col 1 of grid..

 the corrcted code will be same this:-

listR220(myarray);          //display the value of array

  for aryrow := 1 to 72 do
     for grdrow:= 1 to Grid1.RowCount -1 do  
         begin
            if strToint(Grid1.cells[0,grdrow])=myarray[aryrow,1] then
               begin
               Grid1.cells[1,grdrow]:=inttostr( myarray[aryrow,3]);
               end;
          end;
//***************************thanks geobul
and all points will shift to u.
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

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…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
Suggested Courses

656 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