PROFESSIONAL NEWSGROUPS
WINDEV
,
WEBDEV
and
WINDEV Mobile
Home
|
Recent messages
|
Connect
|
Sign out
|
English
Home
→
WINDEV 2024
→
[WD21] Difference of TABLE.. and TABLE[TABLE]..
[WD21] Difference of TABLE.. and TABLE[TABLE]..
Started by Christine Wagner, Jul., 20 2017 12:14 PM - 4 replies
Connect yourself…
Christine Wagner
#1
Posted on July, 20 2017 - 12:14 PM
I can't find this in the tutorial book or the concepts book.
We have code like
IF TABLE_Example[TABLE_Example].COL_Title <> "" THEN
//do something
END
We also have code like
IF TABLE_Example.COL_Title <> "" THEN
//do something
END
There seems to be no difference.
But trying to use TABLE_Example[TABLE_Example]..FontStrikeOut = True works,
trying to use TABLE_Example..FontStrikeOut does not work? (I'm getting an compile error: The 'FontStrikeOut' property does not apply to this type of control.)
So I'm missing something. What is the difference between the two?
Report
0
0
Ruben Sanchez Peña
#2
Posted on July, 20 2017 - 12:31 PM
Hi.
TABLE_Example refer to control table.
TABLE_Example[TABLE_Example] refer to current table line, the last add to table for example.
The properties for table and line are diferents.
Rubén
Report
0
0
Christine Wagner
#3
Posted on July, 21 2017 - 8:21 AM
Thanks for the answer.
So TABLE_Example is different from TABLE_Example[TABLE_Example], but there is really no difference between using TABLE_Example.COL_Title and TABLE_Example[TABLE_Example].COL_Title as both will point to the same column of the current table line.
Greetings
Christine
Report
0
0
DW
#4
Posted on July, 21 2017 - 11:14 AM
Christine,
Both will work but under some situation will fail you, like if the table is empty and you have code on the "Selecting a table row" process of the table control.
Better practice would be something like.
nRow is int = tableselect(TableExample) //Or if you are looping thru the table use "Currentsubscript" nRow is int = CurrentSubscript(TableExample) //This would be for code used on the "Displaying a table row" of a table control if nRow = -1 return (Or error message) TableExample[nRow]..FontBold = true DW
Report
0
0
Christine Wagner
#5
Posted on July, 21 2017 - 4:15 PM
Thanks a lot for this explanation. It is clearer now for me.
Greetings Christine
Report
0
0
→ Go back to WINDEV 2024
WINDEV 2024
WEBDEV 2024
WINDEV Mobile 2024
WINDEV (earlier versions)
Français
English
Español
Portuguesa
Close this window
Search type
Only topics
All the messages
Search period
Any time
Past hour
Past 24 hours
Past week
Past month
Past year
Cancel
Preview of your message
Adding an image
Import an image from a URL
Send an image from a file of your disk
Drop a file or click "Browse..."
or
Cancel
0%
WLanguage
SQL
XML, HTML
JAVA, Javascript
Text