Jump to content

Helo Strings


Recommended Posts

i want make a program that write oppsit the words.

for example:

"hello how are you?" ==> "?uoy era woh olleh"

so i think i have to do for function.

but i have to know the string length.

how i do that?

and how can i know the place of any char..?

any know?

thanks

Link to comment
Share on other sites

i want make a program that write oppsit the words.

for example:

"hello how are you?" ==> "?uoy era woh olleh"

so i think i have to do for function.

but i have to know the string length.

how i do that?

and how can i know the place of any char..?

any know?

thanks

#include <string.au3>
MsgBox(0,"",_Stringreverse("!taerg si elif pleh ehT"))

:)

Broken link? PM me and I'll send you the file!

Link to comment
Share on other sites

why its write the number 3?

#include <GUIConstants.au3>
GUICreate("Transformer By Gil Hanan", 390, 420, 100, 100)   
$Data = GuiCtrlCreateEdit("", 10, 10, 370, 300)
GuiSetState()

$ButtonT = GuiCtrlCreateButton("Transform", 10, 330, 100, 30)

While GuiGetMsg() <> $GUI_EVENT_CLOSE
   $msg = GUIGetMsg()
   If $msg = $ButtonT Then
   $file = FileOpen(@DesktopDir & "\" & "Data.txt" , 1) 
   If $file = -1 Then
    Exit
   EndIf
   Dim $in=$Data, $out
   For $i=StringLen($in) To 1 Step -1
    $out&=StringMid($in,$i,1)
   Next
   FileWrite($file, $out)
   FileClose($file)
   EndIf

    Sleep(1) 
WEnd
Edited by Gillboss
Link to comment
Share on other sites

why its write the number 3?

Because you assign $Data to $in, $Data is not the value of the edit box but the control id that multiple functions use to interact with the control.

To get the data of the edit box use GUICtrlRead($Data) :)

Edited by monoceres

Broken link? PM me and I'll send you the file!

Link to comment
Share on other sites

but now the file not createn..

#include <GUIConstants.au3>
GUICreate("Transformer By Gil Hanan", 390, 420, 100, 100)   
$Data = GuiCtrlCreateEdit("", 10, 10, 370, 300)
GuiSetState()

$ButtonT = GuiCtrlCreateButton("Transform", 10, 330, 100, 30)

While GuiGetMsg() <> $GUI_EVENT_CLOSE
   $msg = GUIGetMsg()
   If $msg = $ButtonT Then
   $file = FileOpen(@DesktopDir & "\" & "Data.txt" , 1) 
   If $file = -1 Then
    Exit
   EndIf
   Dim $in=GUICtrlRead($Data), $out
   For $i=StringLen($in) To 1 Step -1
    $out&=StringMid($in,$i,1)
   Next
   FileWrite($file, $out)
   FileClose($file)
   EndIf

    Sleep(1) 
WEnd
Link to comment
Share on other sites

Fixed it for you.

#include <GUIConstants.au3>

GUICreate("Transformer By Gil Hanan", 390, 420, 100, 100)   
$Data = GuiCtrlCreateEdit("", 10, 10, 370, 300)
$ButtonT = GuiCtrlCreateButton("Transform", 10, 330, 100, 30)
GuiSetState()

$out=""

While 1
   
   $msg = GUIGetMsg()
   
   If $msg = $GUI_EVENT_CLOSE Then ExitLoop
   
   If $msg = $ButtonT Then   
       
        $file = FileOpen(@DesktopDir & "\" & "Data.txt" , 1) ;file open append
   
        If $file = -1 Then
            Exit
        EndIf
   
        ;Dim $in=$Data, $out
   
        $in=GUICtrlRead($data)
           
        For $i=StringLen($in) To 1 Step -1
            $out&=StringMid($in,$i,1)
        Next
        
        FileWrite($file, $out)
        FileClose($file)
        
   EndIf

WEnd
Edited by xircon
Link to comment
Share on other sites

work great, but the file not open (the system can not fine the file...)

#include <GUIConstants.au3>

GUICreate("Transformer By Gil Hanan", 390, 420, 100, 100)  
GUICtrlCreateLabel("Title:" , 10, 10, 70, 20)
$Title = GUICtrlCreateInput("", 50, 10, 300, 20)
GUICtrlCreateLabel("Data:" , 10, 50, 300, 20)
$Data = GuiCtrlCreateEdit("", 10, 70, 340, 300)
$ButtonT = GuiCtrlCreateButton("Transform", 140, 380, 100, 30)
GuiSetState()

$out=""

While 1
   
   $msg = GUIGetMsg()
   
   If $msg = $GUI_EVENT_CLOSE Then ExitLoop
   
   If $msg = $ButtonT Then   
      
        $sum = GUICtrlRead($Title)
        $file = FileOpen(@DesktopDir & "\" & $sum & ".txt" , 1) ;file open append
        If $file = -1 Then
            Exit
        EndIf
        
        $in=GUICtrlRead($data)
          
        For $i=StringLen($in) To 1 Step -1
            $out&=StringMid($in,$i,1)
        Next
       
        FileWrite($file, $out)
        FileClose($file)
        MsgBox(0, "Message", "File has been save successfully in Document dir!")
        Run($file&".txt")
       
   EndIf

WEnd
Link to comment
Share on other sites

i changed but: "canot fin the file XXX.txt", (when XXX = the title..)

#include <GUIConstants.au3>

GUICreate("Transformer By Gil Hanan", 390, 420, 100, 100)  
GUICtrlCreateLabel("Title:" , 10, 10, 70, 20)
$Title = GUICtrlCreateInput("", 50, 10, 300, 20)
GUICtrlCreateLabel("Data:" , 10, 50, 300, 20)
$Data = GuiCtrlCreateEdit("", 10, 70, 340, 300)
$ButtonT = GuiCtrlCreateButton("Transform", 140, 380, 100, 30)
GuiSetState()

$out=""

While 1
   
   $msg = GUIGetMsg()
   
   If $msg = $GUI_EVENT_CLOSE Then ExitLoop
   
   If $msg = $ButtonT Then   
      
        $sum = GUICtrlRead($Title)
        $file = FileOpen(@DesktopDir & "\" & $sum & ".txt" , 1) ;file open append
        If $file = -1 Then
            Exit
        EndIf
        
        $in=GUICtrlRead($data)
          
        For $i=StringLen($in) To 1 Step -1
            $out&=StringMid($in,$i,1)
        Next
       
        FileWrite($file, $out)
        FileClose($file)
        MsgBox(0, "Message", "File has been save successfully in Desktop!")
        ShellExecute($sum&".txt")
        
       
   EndIf

WEnd
Edited by Gillboss
Link to comment
Share on other sites

You have to put the DesktopDir in front of your variable .....

ShellExecute(@DesktopDir & "\" & $sum & ".txt")

*GERMAN* [note: you are not allowed to remove author / modified info from my UDFs]My UDFs:[_SetImageBinaryToCtrl] [_TaskDialog] [AutoItObject] [Animated GIF (GDI+)] [ClipPut for Image] [FreeImage] [GDI32 UDFs] [GDIPlus Progressbar] [Hotkey-Selector] [Multiline Inputbox] [MySQL without ODBC] [RichEdit UDFs] [SpeechAPI Example] [WinHTTP]UDFs included in AutoIt: FTP_Ex (as FTPEx), _WinAPI_SetLayeredWindowAttributes

Link to comment
Share on other sites

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
 Share

  • Recently Browsing   0 members

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