View previous topic :: View next topic |
Author |
Message |
DoT_PiTcH Contributor
Joined: 07 Aug 2002 Posts: 85
|
Posted: Mon Dec 19, 2011 9:44 pm Post subject: WEIRD ERROR |
|
|
Code: |
:SAVE_BUTTONBUTTON
DIALOG DISABLE, SAVE_BUTTON
LIST ADD, 26, @DLGTEXT(EMPLOYEE_COMBO)@TAB()@DLGTEXT(DATE_EDIT)@TAB()%%AERA_CHECKCLICK@TAB()%%OXY_CHECKCLICK@TAB()%%CHEVTEX_CHECKCLICK@TAB()%%OTHER_CHECKCLICK@TAB()@DLGTEXT(OTHER_EDIT)@TAB()%%HOUSEKEEPING_SAFE_CHECKCLICK@TAB()%%HOUSEKEEPING_ATRISK_CHECKCLICK@TAB()@DLGTEXT(HOUSEKEEPING_BARRIERS_COMBO)@TAB()%%WALKWORKSURFACE_SAFE_CHECKCLICK@TAB()%%WALKWORKSURFACE_ATRISK_CHECKCLICK@TAB()@DLGTEXT(WALKWORKSURFACE_BARRIERS_COMBO)@TAB()%%LIGHTING_SAFE_CHECKCLICK@TAB()%%LIGHTING_ATRISK_CHECKCLICK@TAB()@DLGTEXT(LIGHTING_BARRIERS_COMBO)@TAB()%%LINEOFFIRE_SAFE_CHECKCLICK@TAB()%%LINEOFFIRE_ATRISK_CHECKCLICK@TAB()@DLGTEXT(LINEOFFIRE_BARRIERS_COMBO)@TAB()%%PINCHPOINT_SAFE_CHECKCLICK@TAB()%%PINCHPOINT_ATRISK_CHECKCLICK@TAB()@DLGTEXT(PINCHPOINT_BARRIERS_COMBO)@TAB()%%CLIMBING_SAFE_CHECKCLICK@TAB()%%CLIMBING_ATRISK_CHECKCLICK@TAB()@DLGTEXT(CLIMBING_BARRIERS_COMBO)@TAB()%%USEANDSELECTION_SAFE_CHECKCLICK@TAB()%%USEANDSELECTION_ATRISK_CHECKCLICK@TAB()@DLGTEXT(USEANDSELECTION_BARRIERS_COMBO)@TAB()%%CONDITION_SAFE_CHECKCLICK@TAB()%%CONDITION_ATRISK_CHECKCLICK@TAB()@DLGTEXT(CONDITION_BARRIERS_COMBO)@TAB()%%BREAK_SAFE_CHECKCLICK@TAB()%%BREAK_ATRISK_CHECKCLICK@TAB()@DLGTEXT(BREAK_BARRIERS_COMBO)@TAB()%%LIFTING_SAFE_CHECKCLICK@TAB()%%LIFTING_ATRISK_CHECKCLICK@TAB()@DLGTEXT(LIFTING_BARRIERS_COMBO)@TAB()%%TWISTING_SAFE_CHECKCLICK@TAB()%%TWISTING_ATRISK_CHECKCLICK@TAB()@DLGTEXT(TWISTING_BARRIERS_COMBO)@TAB()%%WRISTHAND_SAFE_CHECKCLICK@TAB()%%WRISTHAND_ATRISK_CHECKCLICK@TAB()@DLGTEXT(WRISTHAND_BARRIERS_COMBO)@TAB()%%PUSHPULL_SAFE_CHECKCLICK@TAB()%%PUSHPULL_ATRISK_CHECKCLICK@TAB()@DLGTEXT(PUSHPULL_BARRIERS_COMBO)@TAB()%%LOWERBACK_SAFE_CHECKCLICK@TAB()%%LOWERBACK_ATRISK_CHECKCLICK@TAB()@DLGTEXT(LOWERBACK_BARRIERS_COMBO)@TAB()%%COMPPOLICY_SAFE_CHECKCLICK@TAB()%%COMPPOLICY_ATRISK_CHECKCLICK@TAB()@DLGTEXT(COMPPOLICY_BARRIERS_COMBO)@TAB()%%COMMUNICATION_SAFE_CHECKCLICK@TAB()%%COMMUNICATION_ATRISK_CHECKCLICK@TAB()@DLGTEXT(COMMUNICATION_BARRIERS_COMBO)@TAB()%%FACE_SAFE_CHECKCLICK@TAB()%%FACE_ATRISK_CHECKCLICK@TAB()@DLGTEXT(FACE_BARRIERS_COMBO)@TAB()%%HAND_SAFE_CHECKCLICK@TAB()%%HAND_ATRISK_CHECKCLICK@TAB()@DLGTEXT(HAND_BARRIERS_COMBO)@TAB()%%HEAD_SAFE_CHECKCLICK@TAB()%%HEAD_ATRISK_CHECKCLICK@TAB()@DLGTEXT(HEAD_BARRIERS_COMBO)@TAB()%%FOOT_SAFE_CHECKCLICK@TAB()%%FOOT_ATRISK_CHECKCLICK@TAB()@DLGTEXT(FOOT_BARRIERS_COMBO)@TAB()%%H2S_SAFE_CHECKCLICK@TAB()%%H2S_ATRISK_CHECKCLICK@TAB()@DLGTEXT(H2S_BARRIERS_COMBO)@TAB()%%PARKINGEXITCONES_SAFE_CHECKCLICK@TAB()%%PARKINGEXITCONES_ATRISK_CHECKCLICK@TAB()@DLGTEXT(PARKINGEXITCONES_BARRIERS_COMBO)@TAB()@DLGTEXT(OPERATIONS_BARRIERS_COMBO)@TAB()@DLGTEXT(PROCESS_BARRIERS_COMBO)@TAB()%%COMMENTS
|
I GET ERROR 6 LINE 315
BUT I ONLY GET THIS ERROR ON A WINDOWS XP BOX
RUNS FINE ON MY WIN 7 ULT X64 BOX |
|
Back to top |
|
|
Garrett Moderator Team
Joined: 04 Oct 2001 Posts: 2149 Location: A House
|
Posted: Tue Dec 20, 2011 6:14 pm Post subject: |
|
|
Maybe the dlgtext is too long for XP? _________________ 'What you do not want done to yourself, do not do to others.' - Confucius (550 b.c. to 479 b.c.) |
|
Back to top |
|
|
DoT_PiTcH Contributor
Joined: 07 Aug 2002 Posts: 85
|
Posted: Tue Dec 20, 2011 8:13 pm Post subject: |
|
|
i figured it out the auto line wrap was messing with it.
Next;
I have a table with about 47 columns. if i use the following;
PARSE "%B;%C%D", @ITEM(DATA_TABLE)
I GET AN INVALID LIST FUNCTION
IM ASSUMING %B = COL1 %C=COL2 %D=THE REST OF THE COLUMNS
I NEED COLUMN 1 AND 2 FOR SOME MANIPULATION |
|
Back to top |
|
|
LiquidCode Moderator Team
Joined: 05 Dec 2000 Posts: 1751 Location: Space and Time
|
Posted: Tue Dec 20, 2011 9:42 pm Post subject: |
|
|
Before you try to parse the info from the table, make sure your field sep is set to "|".
If it is anything else, it doesn't work. I know that the table is TAB seperated, but when getting parsing the info right from the table it needs to be set this way.
I think it is a bug in VDS. So your code should look something like..
Code: |
option fieldsep,"|"
parse "%a;%b;%c", @item(table1)
#continue your code... you can change the fsep after if needed
|
Also I see in the code you posted here, there is no ; between %C and %D.
Not sure if that is just in this post, but I thought I would point that out.
Hope this helps. _________________ Chris
Http://theblindhouse.com |
|
Back to top |
|
|
DoT_PiTcH Contributor
Joined: 07 Aug 2002 Posts: 85
|
Posted: Tue Dec 20, 2011 9:53 pm Post subject: |
|
|
Code: |
:EMP_FILTER_COMBOCLICK
DIALOG ENABLE, CLEAR_FILTER_BUTTON
%%EMP_FILTER = @DLGTEXT(EMP_FILTER_COMBO)
LIST SEEK, DATA_TABLE, 0
OPTION FIELDSEP, |
PARSE "%B;%C;%D", @ITEM(DATA_TABLE)
INFO %B
INFO %C
INFO %D
GOTO EVLOOP
|
THIS IS JUST A TEST RUN ON THE FIX GIVEN ABOVE. %B GIVES ALL COLUMNS. %C ERRORS |
|
Back to top |
|
|
Aslan Valued Contributor
Joined: 31 May 2001 Posts: 589 Location: Memphis, TN USA
|
Posted: Wed Dec 21, 2011 1:00 am Post subject: |
|
|
If you are reading a vds table your fieldsep needs to be @tab()
Code: | %%fsep = @fsep()
%%itemData = @ITEM(DATA_TABLE)
option fieldsep,@tab()
PARSE "%B;%C;", %%itemData |
With parse, %D will just be column 3, not the rest of the string so, you can leave it out of your parse statement. With 47 columns you will need to calculate the length of the string minus columns 1, 2 and 2 tabs.
Code: | %%priLen = @sum(@len(%B),@len(%C),2)
%D = @substr(%%itemData,%%priLen,@len(%%itemData))
info %B@cr()%C@cr()%D |
When done return the field separator to what it was.
Code: | option fieldsep,%%fsep |
Your test would look like this;
Code: | :EMP_FILTER_COMBOCLICK
%%FSEP = @FSEP()
DIALOG ENABLE,CLEAR_FILTER_BUTTON
%%EMP_FILTER = @DLGTEXT(EMP_FILTER_COMBO)
LIST SEEK,DATA_TABLE,0
%%ITEMDATA = @ITEM(DATA_TABLE)
OPTION FIELDSEP,@TAB()
PARSE "%B;%C;", @ITEM(DATA_TABLE)
%%priLEN = @SUM(@LEN(%B),@LEN(%C),2)
%D = @SUBSTR(%%ITEMDATA,%%priLEN,@LEN(%%ITEMDATA))
INFO %B
INFO %C
INFO %D
OPTION FIELDSEP,%%FSEP
GOTO EVLOOP |
Edit: Forgot a paranthesis @ %D = @SUBSTR(%%ITEMDATA,%%priLEN,@LEN(%%ITEMDATA))
Note: With so many columns have you considered using an actual database instead of a Table element for manipulation?
With a list that large I would use a database (SQL, Access,...) with vdsdb.dll to do all the manipulation and filtering and then use the Table element just to display the results.
My 2 cents |
|
Back to top |
|
|
LiquidCode Moderator Team
Joined: 05 Dec 2000 Posts: 1751 Location: Space and Time
|
Posted: Wed Dec 21, 2011 1:08 pm Post subject: |
|
|
That's very odd. It doesn't work for me using @tab() as the fsep. I need to use |. I know that they are sep by tabs, but I get errors using @tab(). Not sure why...As long as @tab() works for you, go for it. _________________ Chris
Http://theblindhouse.com |
|
Back to top |
|
|
Aslan Valued Contributor
Joined: 31 May 2001 Posts: 589 Location: Memphis, TN USA
|
Posted: Wed Dec 21, 2011 2:26 pm Post subject: |
|
|
Chris,
That's very odd if you are using "|" for sep on a table element and it works.
I've always used @tab() with VDS 5&6. If you create a table and then save the list to a text file does it have tabs or |s? |
|
Back to top |
|
|
DoT_PiTcH Contributor
Joined: 07 Aug 2002 Posts: 85
|
Posted: Wed Dec 21, 2011 3:15 pm Post subject: |
|
|
thank you that parse "demo" worked, ok will @match() work in tables. i want to match either column 1 or column 2 (name or date) |
|
Back to top |
|
|
Aslan Valued Contributor
Joined: 31 May 2001 Posts: 589 Location: Memphis, TN USA
|
Posted: Wed Dec 21, 2011 3:21 pm Post subject: |
|
|
@match() will work but it will match anything in the item, not any specific column. When you find a match just parse it to see if the match was in the first 2 columns.
If you're trying to use the Table as a datagrid, you will very limited. If you don't want to use an actual database you might consider the following.
Use lists to do the work and then just use the Table for display purposes.
Using your match query as an example.
Data = This where the main body of data resides
Table = Display for the user
Work = Used to build the results
Temp = Used to gather only needed data to query against
Fill the Temp list with just the first 2 columns from the Data list. Do your match query against the Temp list. As you get matches, use the index of the match to get the item from the Data list using the same index and place the item in Work list. Repeat until all matches are found. Then "List Assign" the Work list to the Table for viewing.
Just me thinking out loud.
Last edited by Aslan on Wed Dec 21, 2011 3:51 pm; edited 1 time in total |
|
Back to top |
|
|
DoT_PiTcH Contributor
Joined: 07 Aug 2002 Posts: 85
|
Posted: Wed Dec 21, 2011 3:39 pm Post subject: |
|
|
OK SO IM TRYING THIS
Code: |
:EMP_FILTER_COMBOCLICK
DIALOG ENABLE,CLEAR_FILTER_BUTTON
%%EMP_FILTER = @DLGTEXT(EMP_FILTER_COMBO)
%A = 0
LIST SEEK,DATA_TABLE,%A
repeat
OPTION FIELDSEP,@TAB()
PARSE "%B;%C", @ITEM(DATA_TABLE)
IF @MATCH(%%EMP_FILTER, %B)
ELSE
LIST DELETE, DATA_TABLE
%A = @SUM(%A,1)
LIST SEEK,DATA_TABLE,%A
UNTIL @EQUAL(%A, %%TOTAL_COUNT)
END
GOTO EVLOOP
|
AND IT TELLS ME THAT THE "PARSE" IS AN INVALID LIST COMMAND? AND CRASHES |
|
Back to top |
|
|
Aslan Valued Contributor
Joined: 31 May 2001 Posts: 589 Location: Memphis, TN USA
|
Posted: Wed Dec 21, 2011 3:55 pm Post subject: |
|
|
Your @match() statement is incorrect.
@match() only works with lists not variables.
See my edited post above that I was typing as you added your post |
|
Back to top |
|
|
DoT_PiTcH Contributor
Joined: 07 Aug 2002 Posts: 85
|
Posted: Wed Dec 21, 2011 5:27 pm Post subject: |
|
|
Code: |
:EMP_FILTER_COMBOCLICK
LIST CREATE, 29
LIST LOADFILE, 29, \\192.168.1.3\STAR2K3_D\BBSM V2.0\data.DAT
%%EMP_FILTER = @DLGTEXT(EMP_FILTER_COMBO)
%A = 0
LIST SEEK,29,%A
OPTION FIELDSEP,@TAB()
repeat
PARSE "%B;%C", @ITEM(29)
INFO %B@CR()%%EMP_FILTER
IF @NOT(@EQUAL(%B,%%EMP_FILTER, EXACT))
LIST DELETE, 29
ELSE
%A = @SUM(%A,1)
LIST SEEK,29,%A
UNTIL @EQUAL(%%TOTAL_COUNT,%A)
END
LIST CLEAR, DATA_TABLE
LIST ASSIGN, DATA_TABLE, 29
DIALOG ENABLE,CLEAR_FILTER_BUTTON
%%TOTAL_COUNT = @COUNT(29)
DIALOG SET, COUNT_LABEL, %%TOTAL_COUNT
LIST CLOSE, 29
GOTO EVLOOP
|
OK SO TRYING THE @MATCH WITH THE TEMP LIST JUST SCREWS UP AND DELETES ALL THE DATA AFTER FIRST TAB.
SAME WITH @NOT @EQUAL
SHOULD I DO A @TEXT(29) AND GO FROM THERE?
PS. I DO NOT KNOW REAL DB STUFF AND THIS IS A SMALL WORK UTILITY SO BUT VDSDB.DLL ISNT GONNA HAPPEN. EVEN IF I EXPENSE IT FOR MY SELF |
|
Back to top |
|
|
Aslan Valued Contributor
Joined: 31 May 2001 Posts: 589 Location: Memphis, TN USA
|
Posted: Wed Dec 21, 2011 5:45 pm Post subject: |
|
|
Give me some time and I'll try to create an example for you
Maybe tonight... |
|
Back to top |
|
|
DoT_PiTcH Contributor
Joined: 07 Aug 2002 Posts: 85
|
Posted: Wed Dec 21, 2011 5:52 pm Post subject: |
|
|
THANK YOU! |
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You can attach files in this forum You can download files in this forum
|
|