FORUMS PROFESSIONNELS
WINDEV
,
WEBDEV
et
WINDEV Mobile
Accueil
|
Messages récents
|
Connexion
|
Déconnexion
|
Français
Accueil
→
WINDEV 2024
→
OOP
OOP
Débuté par John Marrone, 24 juil. 2004 19:53 - 2 réponses
Connectez-vous…
John Marrone
#1
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
Signaler
0
0
Jeroen de Jonge
#2
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
Signaler
0
0
Raimund Schuldhaus
#3
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
Signaler
0
0
→ Revenir à WINDEV 2024
WINDEV 2024
WEBDEV 2024
WINDEV Mobile 2024
WINDEV (précédentes versions)
Français
English
Español
Portuguesa
Fermer cette fenêtre
Type de recherche
Uniquement les sujets
Tous les messages
Période de recherche
Date indifférente
Moins d'une heure
Moins de 24 heures
Moins d'une semaine
Moins d'un mois
Moins d'un an
Annuler
Aperçu de votre message
Ajouter une image
Importer une image depuis une URL
Envoyer une image depuis un fichier de votre disque
Déposez ici un fichier ou cliquez sur "Parcourir..."
ou
Annuler
0%
WLangage
SQL
XML, HTML
JAVA, Javascript
Texte