Jump to content

stringtrimright


 Share

Recommended Posts

why does this not trim right?

#include<misc.au3>
$file = FileOpen("testing.txt",1)
while 1
    if _IsPressed("08") then StringTrimRight($file,1);backspace
    if _IsPressed("5a") Then;Z
        FileClose($file)
        Exit
    EndIf
WEnd
[u][font="Century Gothic"]~я α и d γ ĵ . ċ . ѕ қ ϊ и и ε я~- My Programs -auto shutdownSleep funcdisallow programs[/font][/u]
Link to comment
Share on other sites

why does this not trim right?

#include<misc.au3>
$file = FileOpen("testing.txt",1)
while 1
    if _IsPressed("08") then StringTrimRight($file,1);backspace
    if _IsPressed("5a") Then;Z
        FileClose($file)
        Exit
    EndIf
WEnd
You have your file open in write mode. You aren't reading anything in the file. Use FileRead to read the data and assign it to a variable and trim the variable.

My Projects: [topic="89413"]GoogleHack Search[/topic], [topic="67095"]Swiss File Knife GUI[/topic], [topic="69072"]Mouse Location Pointer[/topic], [topic="86040"]Standard Deviation Calculator[/topic]

Link to comment
Share on other sites

#include<misc.au3>
$file = FileOpen("testing.txt", 1)
$fileread = FileRead($file)
While 1
    If _IsPressed("08") Then StringTrimRight($fileread,1);backspace
    If _IsPressed("5a") Then;Z
        FileClose($file)
        Exit
    EndIf
WEnd

You need something along the lines of...

My Projects: [topic="89413"]GoogleHack Search[/topic], [topic="67095"]Swiss File Knife GUI[/topic], [topic="69072"]Mouse Location Pointer[/topic], [topic="86040"]Standard Deviation Calculator[/topic]

Link to comment
Share on other sites

#include<misc.au3>
$file = FileOpen("testing.txt", 1)
$fileread = FileRead($file)
While 1
    If _IsPressed("08") Then StringTrimRight($fileread,1);backspace
    If _IsPressed("5a") Then;Z
        FileClose($file)
        Exit
    EndIf
WEnd

You need something along the lines of...

that would be the slower way of doing it, is there anything quicker?
[u][font="Century Gothic"]~я α и d γ ĵ . ċ . ѕ қ ϊ и и ε я~- My Programs -auto shutdownSleep funcdisallow programs[/font][/u]
Link to comment
Share on other sites

Check out the user-defined functions for file management in the help file.

My Projects: [topic="89413"]GoogleHack Search[/topic], [topic="67095"]Swiss File Knife GUI[/topic], [topic="69072"]Mouse Location Pointer[/topic], [topic="86040"]Standard Deviation Calculator[/topic]

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...