HP Forums

Full Version: search in a spreadsheet?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hallo,

how can i search in a spreadsheet with a loop data search an then take the data in a new program?

Example:

Search EDLK

Spreadsheet:
A B C D E F ...
1 EDAG 122.458 94.0124 7.8756
2 EDHJ 121.354 93.4536 7.125
3 EDLK 120.050 93.1547 7.024
4 EDOP 123.012 92.0124 7.698
an so on

Find EDLK in A3 an then Print A3, B3, C3, D3 also EDLK 120.050 93.1547 7.024

EXPORT Navigation()
BEGIN
LOCAL I,A,B,C,D,E;
PRINT();
STARTAPP("Flugplatz");
I:=1;
FOR I FROM 1 To 10 Step 1 DO

PRINT (A(I));
// PRINT (B(I));
//PRINT (C(I));
//PRINT (D(I));
//PRINT (E(I));
END;
FREEZE;
END;

I hope, you can understand this!?

Best Regards Heino
Try this:

Code:
Rw:=POS(a:a,"EDLK");
VRw:=EXPR(Rw+":"+Rw);

Care with the number format, use Rw: = STRING (Rw, 1)
(03-06-2017 02:32 PM)Carlos295pz Wrote: [ -> ]Try this:

Code:
Rw:=POS(a:a,"EDLK");
VRw:=EXPR(Rw+":"+Rw);

Care with the number format, use Rw: = STRING (Rw, 1)

I mean this one, but its a mistake!

EXPORT Navigation()
BEGIN
LOCAL I,A,B,C,D,E;
PRINT();
STARTAPP("Flugplatz");
I:=1;
FOR I FROM 1 To 10 Step 1 DO

PRINT (A(I));
// PRINT (B(I));
//PRINT (C(I));
//PRINT (D(I));
//PRINT (E(I));
END;
FREEZE;
END;

Great, thanks Carlos.
The first problem is solved,
now the second one.

Here the solution:

EXPORT Navigation()
BEGIN
LOCAL I,A,B,C,D,E;
RECT();
STARTAPP("Flugplatz");
I:=1;
FOR I FROM 1 To 10 Step 1 DO
TEXTOUT_P((EXPR("A"+I)),0,20);
TEXTOUT_P((EXPR("B"+I)),50,20);
TEXTOUT_P((EXPR("C"+I)),130,20);
TEXTOUT_P((EXPR("D"+I)),190,20);
TEXTOUT_P((EXPR("E"+I)),260,20);
// PRINT (EXPR("A"+I));
// PRINT (EXPR("B"+I));
// PRINT (EXPR("C"+I));
// PRINT (EXPR("D"+I));
// PRINT (EXPR("E"+I));
WAIT(2); RECT();
END;
FREEZE;
END;
An alternative

Code:
EXPORT Navigation()
BEGIN
 LOCAL Rw,VRw,Cx={0,50,130,190,260};
 STARTAPP("Flugplatz");
 WHILE INPUT({{Rw,a:a}}) DO
  LOCAL RwF=STRING(Rw,1); //Format
  VRw:=EXPR(RwF+":"+RwF);
  RECT;
  ITERATE(X+1+0*TEXTOUT_P(Cell(Rw,X),Cx(X),20),X,1,5);
  WAIT(-1)
 END
END;
Reference URL's