Derniers sujets from ?Forum WDScript?
Derniers sujets from ?Forum WDScript? forum.
rtf et table
Bonjour,
je cherche à afficher des informations formatées en gras et couleur dans les céllules d'une table avec l'option RTF
Mes informations proviennent d'une requete, et doivent parfois sur des colonnes déjà renseignées y ajouter de nouvelles informations avec une autre couleur.
lorsque je fait tableinsertligne , ça marche bien.
mais lorsque je doit concacéner d'autres informations sur la même celulle, j'ai un PB.
je récupère les infos déjà présentes dans la colonne, dans un champ RTF auxquelles j'ajoute les nouvelles en voulant leur donner une couleur de police différente.
Ensuite, je mets le contenu du champs RTF dans la colonne.
Mais là, je me retrouve avec un tas d'annotations dans la colonne (qui sont celles caractérisant le formatage des données du champs RTF)
Y a t il un moyen d'effectuer mon traitement ou de contourner le pb.
Merci à tous.
je cherche à afficher des informations formatées en gras et couleur dans les céllules d'une table avec l'option RTF
Mes informations proviennent d'une requete, et doivent parfois sur des colonnes déjà renseignées y ajouter de nouvelles informations avec une autre couleur.
lorsque je fait tableinsertligne , ça marche bien.
mais lorsque je doit concacéner d'autres informations sur la même celulle, j'ai un PB.
je récupère les infos déjà présentes dans la colonne, dans un champ RTF auxquelles j'ajoute les nouvelles en voulant leur donner une couleur de police différente.
Ensuite, je mets le contenu du champs RTF dans la colonne.
Mais là, je me retrouve avec un tas d'annotations dans la colonne (qui sont celles caractérisant le formatage des données du champs RTF)
Y a t il un moyen d'effectuer mon traitement ou de contourner le pb.
Merci à tous.
WDScript sous linux... possible ?
Apres quelques modifications du code source et la fabrication d'une librairie pour avec acces à la fonction SysEnvironnement (qui ne fonctionne pas sous linux ni en wd11 ni en 12)
Je suis pour le moment bloqué sur un probleme de la fonction Compile (comportement identique sous Debian et Fedora)
Je suis pour le moment bloqué sur un probleme de la fonction Compile (comportement identique sous Debian et Fedora)
[WD5] Récupérer les Rendez-vous outlook
Source : http://www.xs4all.nl/~petervu/
Outlook appointments
retrieve Outlook appointments from a server and put it in a table
Outlook appointments
retrieve Outlook appointments from a server and put it in a table
- sCriteria is fixed string on 1000
- sCritStart, sCritEnd are string
- sHulp is string
- sDate is array of 2 string
- sTime is array of 2 string
- cuHulp is array of 2 currency
- objOutlook is object ole dynamic
- objNameSpace is object ole dynamic
- objFolders is object ole dynamic
- objItems is object ole dynamic
- objAppt is object ole dynamic
- When Exception
- error("Automation Error: "+exception.code+" "+exception.message+" "+ ...
- Exception.Procedure+" "+Exception.Line)
- //... etc
- End
- objOutlook = new object ole "Outlook.Application"
- objNameSpace = objOutlook>>GetNameSpace("MAPI")
- sLogin = "myLogin"
- sPassw = "myPass"
- objNameSpace>>Logon(sLogin,sPassw,Olefalse,oletrue)
- skFolder[1]="Public Folder"
- skFolder[2]="All Public Folders"
- skFolder[3]="Bedrijfs Agenda"
- objFolders = objNameSpace>>Folders(skFolder[1])>>Folders(skFolder[2])>>Folders(skFolder[3])
- objItems = objFolders>>Items()
- sCritStart="[Start]> = '"+datetostring(integertodate(datetointeger(datesys())-1))+" 23:59'"
- sCritEnd="[End]<= '"+datetostring(integertodate(datetointeger(datesys())+1))+"'"
- sCriteria = sCritStart+" and "+sCritEnd //today
- objAppt = objItems>>Find(sCriteria)
- while objAppt <> null
- sHulp = objAppt>>Start() //From
- cuHulp[1]=val(sHulp[[1 to 5]])-2+datetointeger("19000101")
- sDate[1]=datetostring(integertodate(cuHulp))
- cuHulp[1]=integerpart(round(val(sHulp[[6 to ]])*24,2)) //hours
- cuHulp[2]=round(decimalpart(round(val(sHulp[[6 to ]])*24,2))*60,0) //minutes
- sTime[1]=numtostring(cuHulp[1],"02d")+":"+numtostring(cuHulp[2],"02d")
- sHulp = objAppt>>End() //Until
- // idem
- tableadd("table1", stringtodate(sDate[1])+tab+sTime[1]+tab+sTime[2]+tab+ ...
- objAppt>>Location()+tab+objAppt>>Subject())
- calldll32("user32","UpdateWindow",handle())
- if calldll32("user32","GetInputState") then multitask(-1)
- objAppt = objItems>>FindNext()
- end
- objNameSpace>>Logoff()
- delete objAppt
- delete objItems
- delete objFolders
- delete objNameSpace
- delete objOutlook
- when exception
- end
Créer un fichier XML par une connexion / requete ADODB
Source : http://www.xs4all.nl/~petervu/
retrieve an Access file via ADODB and create a XML file
retrieve an Access file via ADODB and create a XML file
- adPersistXML is long int = 1
- adUseClient is long int = 3
- adUseServer is long int = 2
- adOpenDynamic is long int= 2
- adOpenForwardOnly is long int= 0
- adOpenKeyset is long int= 1
- adOpenStatic is long int= 3
- sConnstr is String
- sConnstr = "PROVIDER=MSDASQL;" +...
- "DRIVER={Microsoft Access Driver (*.mdb)};"+...
- "DBQ=c:\temp\test.mdb;"
- objConn is object ole "ADODB.CONNECTION"
- objConn>>Open(sConnStr)
- //Create and set the record set information
- rs is object ole dynamic
- rs = new OLE "ADODB.Recordset"
- rs>>ActiveConnection = objConn
- rs>>CursorLocation = adUseClient
- rs>>Open("select * from AccessTable")
- rs>>Save("c:\temp\ATxml.xml",adPersistXML)
- rs>>Close()
- delete rs
- objConn>>Close()
Récupérer le chemin complet d'un lecteur réseau
Source : http://www.xs4all.nl/~petervu/
retrieve an UNC network path starting from a drive letter
retrieve an UNC network path starting from a drive letter
- //Possible return codes from the API
- //Public Const ERROR_BAD_DEVICE As Long = 1200
- //Public Const ERROR_CONNECTION_UNAVAIL As Long = 1201
- //Public Const ERROR_EXTENDED_ERROR As Long = 1208
- //Public Const ERROR_MORE_DATA As Long = 234
- //Public Const ERROR_NOT_SUPPORTED As Long = 50
- //Public Const ERROR_NO_NET_OR_BAD_PATH As Long = 1203
- //Public Const ERROR_NO_NETWORK As Long = 1222
- //Public Const ERROR_NOT_CONNECTED As Long = 2250
- //Public Const NO_ERROR As Long = 0
- liDLLInst is long int
- szLocalName is asciiz string on 256
- szRemoteName is asciiz string on 256
- liBuffer is long int
- res is long int
- szLocalName="z:"
- liBuffer=dimension(szRemoteName)
- res=calldll32("mpr.dll","WNetGetConnectionA",&szLocalName,&szRemoteName,&liBuffer)
- if res>0 then
- error(res)
- //etc
- end
- info(szRemoteName)
Récupérer l'icone associée à une fichier
get icon from file (ExtractIconA)
get associated icon from file (ExtractAssociatedIconA)
get icon from file (SHGetFileInfoA)
- hIcon, hInst, nIconIndex, hdc are long int
- szExeFileName is asciiz string on 260 = "c:\Windev55\Windev\windev55.exe"
- hInst=instance()
- hIcon=CallDLL32("Shell32.dll","ExtractIconA",hInst,&szExeFileName,nIconIndex)
- if hIcon>0 then
- dendDrawing()
- hdc=dstartdrawing("image1")
- Calldll32("user32","DrawIcon",hdc,0,0,hIcon)
- dsaveimage("image1","blabla.bmp")
- calldll32("user32","DestroyIcon",hIcon)
- end
get associated icon from file (ExtractAssociatedIconA)
- hIcon, hInst, nIconIndex, hdc are long int
- szExeFileName is asciiz string on 260 = "c:\down\tutorial\StarOffice_tutorial.pdf"
- hInst=instance()
- hIcon=CallDLL32("Shell32.dll","ExtractAssociatedIconA",hInst,&szExeFileName,nIconIndex)
- if hIcon>0 then
- dendDrawing()
- hdc=dstartdrawing("image1")
- Calldll32("user32","DrawIcon",hdc,0,0,hIcon)
- dsaveimage("image1","blabla.bmp")
- calldll32("user32","DestroyIcon",hIcon)
- end
get icon from file (SHGetFileInfoA)
- SHFILEINFO is structure
- hIcon is Long int //out: icon
- iIcon is long int //out: icon index
- dwAttributes is Long int // out: SFGAO_ flags
- szDisplayName is asciiz String on 260 //* MAX_PATH ' out: displayname (or path)
- szTypeName is asciiz String on 80 //* 80 ' out: type name
- End
- SHGFI_DISPLAYNAME is long int = 0x200
- SHGFI_EXETYPE is long int= 0x2000
- SHGFI_ICON IS LONG INT =0x100
- SHGFI_OPENICON IS LONG INT= 0x2
- SHGFI_SELECTED IS LONG INT= 0x10000
- SHGFI_SYSICONINDEX is long int= 0x4000 // ' system icon index
- SHGFI_LARGEICON is long int= 0x0 // '32x32 icon
- SHGFI_SMALLICON is long int= 0x1 // '16x16 icon
- SHGFI_SHELLICONSIZE is long int= 0x4
- SHGFI_TYPENAME is long int = 0x400
- SFGAO_HASSUBFOLDER IS LONG INT = 0x80000000 //check che presence of the HASSUBFOLDER attribute
- SHGFI_ATTRIBUTES IS LONG INT= 0x800 // retrieve the folder's attributes
- retval is long int
- hIcon, hInst, nIconIndex are long int
- hdc is long int
- szFileName is asciiz string on 260
- szFileName = "c:\down\tutorial\StarOffice_tutorial.pdf"
- FI is SHFILEINFO
- retval=calldll32("shell32","SHGetFileInfoA",&szFileName,0,&FI,dimension(FI),SHGFI_ICON+SHGFI_SMALLICON)
- if fi:hIcon>0 then
- dendDrawing()
- hdc=dstartdrawing("image1")
- Calldll32("user32","DrawIcon",hdc,0,0,fi:hIcon)
- dsaveimage("image1","blabla.bmp")
- calldll32("user32","UpdateWindow",handle())
- calldll32("user32","DestroyIcon",fi:hIcon)
- end
Langage de Script Windows (FileSystemObject)
Source : http://www.xs4all.nl/~petervu/
Different FileSystemObject functions
(to allow you to manipulate the file system from Active Server Pages)
create & write ascii file
copy folders
delete folders
read file
Different FileSystemObject functions
(to allow you to manipulate the file system from Active Server Pages)
create & write ascii file
- fs is ole "Scripting.FileSystemObject"
- objT is ole dynamic
- objT=fs>>CreateTextFile("c:\temp\somefile.txt")
- objT>>WriteLine("Hello World!")
- objT>>close()
- delete objT
copy folders
- fs is ole "Scripting.FileSystemObject"
- fs>>CopyFolder("c:\temp\folder1","c:\temp\folder2",true)
delete folders
- fs is ole "Scripting.FileSystemObject"
- fs>>DeleteFolder("c:\temp\folder2",true)
read file
- fsoForReading is int=1
- fs is ole "Scripting.FileSystemObject"
- objT is ole dynamic
- if fs>>FileExists("C:\Temp\folder1\menu_dom.js") then
- objT=fs>>OpenTextFile("C:\Temp\folder1\menu_dom.js", fsoForReading)
- e1=objT>>ReadAll() //e1=text edit control
- objT>>close()
- delete objT
- end
Téléchargement par ActiveX Internet Explorer Invisible
Source : http://www.xs4all.nl/~petervu/
- objIE is object automation "InternetExplorer.Application"
- objIE>>Visible = false
- objIE>>Navigate("http://www.windevasso.org/")
- while objIE>>Busy = true
- multitask(10)
- end
- multitask(100)
- while upper(objIE>>Document>>ReadyState())<>"COMPLETE"
- multitask(100)
- end
- fs is object automation "Scripting.FileSystemObject"
- stream is object automation dynamic
- stream = fs>>CreateTextFile("c:\temp\blabla.html")
- stream>>Write(objIE>>Document>>Body>>InnerHTML()) //only text > InnerText()
- stream>>Close()
- delete stream
Récupérer le chemin d'un répertoire spécial de windows
Source : http://www.xs4all.nl/~petervu/
MSDN : http://msdn2.microsoft.com/en-us/library/bb762204.aspx
MSDN : http://msdn2.microsoft.com/en-us/library/bb762204.aspx
- CONSTANT
- CSIDL_DESKTOP = 0x0
- CSIDL_INTERNET = 0x1
- CSIDL_PROGRAMS = 0x2
- CSIDL_CONTROLS = 0x3
- CSIDL_PRINTERS = 0x4
- CSIDL_PERSONAL = 0x5
- CSIDL_FAVORITES = 0x6
- CSIDL_STARTUP = 0x7
- CSIDL_RECENT = 0x8
- CSIDL_SENDTO = 0x9
- CSIDL_BITBUCKET = 0xA
- CSIDL_STARTMENU = 0xB
- CSIDL_MYDOCUMENTS = 0xC
- CSIDL_MYMUSIC = 0xD
- CSIDL_MYVIDEO = 0xE
- CSIDL_DESKTOPDIRECTORY = 0x10
- CSIDL_DRIVES = 0x11
- CSIDL_NETWORK = 0x12
- CSIDL_NETHOOD = 0x13
- CSIDL_FONTS = 0x14
- CSIDL_TEMPLATES = 0x15
- CSIDL_COMMON_STARTMENU = 0x16
- CSIDL_COMMON_PROGRAMS = 0x17
- CSIDL_COMMON_STARTUP = 0x18
- CSIDL_COMMON_DESKTOPDIRECTORY = 0x19
- CSIDL_APPDATA = 0x1A
- CSIDL_PRINTHOOD = 0x1B
- CSIDL_LOCAL_APPDATA = 0x1C
- CSIDL_ALTSTARTUP = 0x1D
- CSIDL_COMMON_ALTSTARTUP = 0x1E
- CSIDL_COMMON_FAVORITES = 0x1F
- CSIDL_INTERNET_CACHE = 0x20
- CSIDL_COOKIES = 0x21
- CSIDL_HISTORY = 0x22
- CSIDL_COMMON_APPDATA = 0x23
- CSIDL_WINDOWS = 0x24
- CSIDL_SYSTEM = 0x25
- CSIDL_PROGRAM_FILES = 0x26
- CSIDL_MYPICTURES = 0x27
- CSIDL_PROFILE = 0x28
- CSIDL_SYSTEMX86 = 0x29
- CSIDL_PROGRAM_FILESX86 = 0x2A
- CSIDL_PROGRAM_FILES_COMMON = 0x2B
- CSIDL_PROGRAM_FILES_COMMONX86 = 0x2C
- CSIDL_COMMON_TEMPLATES = 0x2D
- CSIDL_COMMON_DOCUMENTS = 0x2E
- CSIDL_COMMON_ADMINTOOLS = 0x2F
- CSIDL_ADMINTOOLS = 0x30
- CSIDL_CONNECTIONS = 0x31
- CSIDL_COMMON_MUSIC = 0x35
- CSIDL_COMMON_PICTURES = 0x36
- CSIDL_COMMON_VIDEO = 0x37
- CSIDL_RESOURCES = 0x38
- CSIDL_RESOURCES_LOCALIZED = 0x39
- CSIDL_COMMON_OEM_LINKS = 0x3A
- CSIDL_CDBURN_AREA = 0x3B
- CSIDL_COMPUTERSNEARME = 0x3D
- CSIDL_FLAG_PER_USER_INIT = 0x0800
- CSIDL_FLAG_NO_ALIAS = 0x1000
- CSIDL_FLAG_DONT_VERIFY = 0x4000
- CSIDL_FLAG_CREATE = 0x8000
- CSIDL_FLAG_MASK = 0xFF00
- end
- //Get DESKTOP path
- szPath is asciiz string on 260
- calldll32("shell32","SHGetSpecialFolderPathA",null,&szPath,CSIDL_DESKTOP,0)
- info(szPath)
[WD] Récupérer le contenu d'un champ de saisie multiligne
Via SendMessage
Source : http://www.xs4all.nl/~petervu/
The EM_GETLINE message copies a line of text from an edit control
Source : http://www.xs4all.nl/~petervu/
The EM_GETLINE message copies a line of text from an edit control
- CONSTANT
- EM_GETLINECOUNT = 0xBA
- EM_LINEINDEX = 0xBB
- EM_LINELENGTH = 0xC1
- EM_GETLINE = 0xC4
- END
- //Get number of lines > edit1 = multiline_edit_control
- lngLineCount is int
- lngLineCount = SendMessage(Handle(Edit1), EM_GETLINECOUNT, 0, 0)
- lngRetValue is int
- lngLineNumber is int
- lngIndexChar is int
- intLineLength is int on 2 bytes
- strLine is ASCIIZ string on 128
- lngLineNumber = x //must be <= lngLineCount
- lngLineNumber = lngLineNumber - 1
- lngIndexChar = SendMessage(Handle(Edit1), EM_LINEINDEX, lngLineNumber, 0)
- intLineLength = SendMessage(Handle(Edit1), EM_LINELENGTH, lngIndexChar, 0)
- strLine=Complete(Charact(LoWord(intLineLength))+Charact(HiWord(intLineLength)),intLineLength)
- lngRetValue = SendMessage(Handle(Edit1), EM_GETLINE, lngLineNumber, &strLine)
- Info(strLine)
Flux RSS
Tous les derniers posts du forum de WDScript !
Rubrique Flux RSS Windev - Nb abonnés : 8
Rubrique Flux RSS Windev - Nb abonnés : 8
| Adresse du flux RSS à copier/coller |


wdscript - le forum