Jump to content

Recommended Posts

Posted

hmm, i have another obstacle on my way xD.

The problem is that i want to write a log file from an input.

i tried many ways and all ended in failure.

i tried:

_FileWriteLog (@SysDir & "\file\save.log",GUICtrlRead($misc))

$misc is the Input av

_FileWriteLog (@SysDir & "\file\save.log",$misc

none of those work.

im new in log , ini , dll stuff so. sorry if im making an horrible mistake xD.

Posted

Provide a bigger section of you code. Preferably something that works (or don't work but should n your opinion).

Something like

$gui = GuiCreate("My test")
$inp = GuiCtrlCreateInput("This is my text" @Hour & ":" & @MIN  & ":" & @SEC, 10, 10 )
GuiSetState(@SW_SHOW)
Sleep(500)
FileWrite("C:`mylog.log", GuiCtrlRead($inp))
Posted (edited)

Ok, here it is.

#include <GUIConstants.au3> 
#include <File.au3> 
GUICreate("programl",200,200) 
$misc=GUICtrlCreateInput ("",100,100,110,20) 
$save=GUICtrlCreateButton ("save",50,50) 
GUISetState () 
While 1 
   $msg = GUIGetMsg() 
   Select 
       Case $msg = $GUI_EVENT_CLOSE 
           ExitLoop 
Case $msg = $save
               _FileWriteLog (@SystemDir & "\file\save.log",GUICtrlRead($misc)) 
   EndSelect 
Wend

I just want to save what you typed in the input save it on the log file.

Cheers.

Anti

Edited by AntiBNI
Posted (edited)

Ok, here it is.

#include <GUIConstants.au3> 
#include <File.au3> 
GUICreate("programl",200,200) 
$misc=GUICtrlCreateInput ("",100,100,110,20) 
$save=GUICtrlCreateButton ("save",50,50) 
GUISetState () 
While 1 
   $msg = GUIGetMsg() 
   Select 
       Case $msg = $GUI_EVENT_CLOSE 
           ExitLoop 
Case $msg = $save
               _FileWriteLog (@SystemDir & "\file\save.log",GUICtrlRead($misc)) 
   EndSelect 
Wend

I just want to save what you typed in the input save it on the log file.

Cheers.

Anti

Looks ok to me, but areyou sure you have a folder @SystemDir & "\file"? Edited by martin
Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.
Posted

yeah, i dont know whats wrong but it aint creating the file.

hi

i changed a bit for debugging , works here fine now ??

make shure you have the system rights to save file and directory exists .?

#include <GUIConstants.au3> 
#include <File.au3> 
GUICreate("programl",200,200) 
$misc=GUICtrlCreateInput ("",100,100,90,20) 
$save=GUICtrlCreateButton ("save",50,50) 
GUISetState () 
While 1 
   $msg = GUIGetMsg() 
   Select 
       Case $msg = $GUI_EVENT_CLOSE 
           ExitLoop 
       Case $msg = $save
                $my_line = GUICtrlRead($misc);
                MsgBox(0, "info" , $my_line );

                $f= @SystemDir & "\file\mysave.log"
                MsgBox(0, "file" , $f );
               _FileWriteLog ($f,   $my_line )              
   EndSelect 
Wend

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...