PC SOFT

FORUMS PROFESSIONNELS
WINDEVWEBDEV et WINDEV Mobile

Accueil → WINDEV 2024 → OOP
OOP
Débuté par John Marrone, 24 juil. 2004 19:53 - 2 réponses
Posté le 24 juillet 2004 - 19:53
I am having trouble understanding the syntax for oop. Here are some questions.
The source code below is from the help file.
FileS is File
FileD is file
ch1,ch2 are strings
//calling the file selection method
FileS :FileSelection()
FileD :FileSelection()

Question: Is the space suppose to be after the S in FileS???
//calling the method that checks the available space
If FileS:RemainingSpace(FileD :Directory) then
ch1= FileS:Directory+"\"+FileS :Name+"."+FileS :Extension
----------^---------------------^
-----No space here???------Space here???
What is going on.
ch1= FileD:Directory+"\"+FileD :Name+"."+FileD :Extension
fFileCopy(ch1,ch2)
else
Error("Insufficient space")
End
They also use :: when they create the method. Is this the only time you would use :: ?
What happen to FileS..Name syntax??
Any and all help is greatfully accepted. Hints and tips also.
Thanks
John Marrone
Posté le 24 juillet 2004 - 21:29
Forget the spaces. There are no spaces between the object and the method.
The difference between files..name and files:name is that in the first situation "name" is a property of "files", in the second situation "name" is a method (procedure) or a variable of the object "files".


I am having trouble understanding the syntax for oop. Here are some questions.
The source code below is from the help file.
FileS is File
FileD is file
ch1,ch2 are strings
//calling the file selection method
FileS :FileSelection()
FileD :FileSelection()

Question: Is the space suppose to be after the S in FileS???
//calling the method that checks the available space
If FileS:RemainingSpace(FileD :Directory) then
ch1= FileS:Directory+"\"+FileS :Name+"."+FileS :Extension
----------^---------------------^
-----No space here???------Space here???
What is going on.
ch1= FileD:Directory+"\"+FileD :Name+"."+FileD :Extension
fFileCopy(ch1,ch2)
else
Error("Insufficient space")
End
They also use :: when they create the method. Is this the only time you would use :: ?
What happen to FileS..Name syntax??
Any and all help is greatfully accepted. Hints and tips also.
Thanks
John Marrone
Posté le 24 juillet 2004 - 23:18
Hi John,
:: will b e used if you have to use types or constant declared for a class. A :: is also for global method of a class.
Eg.
constant
cConst = 1
end
clMyClass is class
end
procdure method1(param1 is int, param2 is int = clMyClass::cConst)
HTH
Raimund

I am having trouble understanding the syntax for oop. Here are some questions.
The source code below is from the help file.
FileS is File
FileD is file
ch1,ch2 are strings
//calling the file selection method
FileS :FileSelection()
FileD :FileSelection()

Question: Is the space suppose to be after the S in FileS???
//calling the method that checks the available space
If FileS:RemainingSpace(FileD :Directory) then
ch1= FileS:Directory+"\"+FileS :Name+"."+FileS :Extension
----------^---------------------^
-----No space here???------Space here???
What is going on.
ch1= FileD:Directory+"\"+FileD :Name+"."+FileD :Extension
fFileCopy(ch1,ch2)
else
Error("Insufficient space")
End
They also use :: when they create the method. Is this the only time you would use :: ?
What happen to FileS..Name syntax??
Any and all help is greatfully accepted. Hints and tips also.
Thanks
John Marrone



http://www.invitec.com