Hi,
I've managed to use the Number Edit Box() function combined with Char() to retrive strings from a column in order to delete specific rows from my tables. However my code does not work for all situations, why?
Is there another Edit Box for strings? Does anyone have another sugestion for entering strings (through a edit box), comparing each value in a specified column to that string and if match/not match fill a second column with Yes/No? The values in the specified columns will have format character but be a mix of numbers and chars.
I've got the following code:
Window= New Window( "Statement here...",
ListREF = {};
ListOBJ = {};
H List Box(
Text Box( "Statement here...", " ),
Spacer Box( size( 1, 10 ) ),
editBox= Number Edit Box( "" ),
i = 1;
j = 1;
Spacer Box( size( 1, 10 ) ),
Button Box( "Statement here...", ",
Data Table( "Main Table" ) << Select Where( :Column3== (Char( editBox<< get )) );
editBox<< Set( . );
Data Table( "Main Table" ) << Subset( Invisible, (Selected Rows) );
Selected( Row State( 10 ) ) = 1;
Data Table( "Table" ) << delete rows;
.......
Output:
Before deletion:
Main Table
Col1 Col2[Numeric] Col3 [character]
Obj1 1234 "MyObject"
Obj2 5678 "MyRef1"
in my Edit Box I type MyRef1 and the result is:
Main Table
Col1 Col2[Numeric] Col3 [character]
Obj1 1234 "MyObject"
Subset Main Table
Col1 Col2[Numeric] Col3 [character]
Obj2 5678 "MyRef1"