Ask Experts Questions for FREE Help!
  Advanced
Register  |  Log in  
   Ask    
 Answer  
  Help  

Ask QuestionsprogressAnswer QuestionsprogressBuild ReputationprogressBecome an Expert
 
Free Answers in 3 Easy Steps

Register Now
3 Steps

At Ask Me Help Desk you can ask questions in any topic and have them answered for free by our experts. To ask questions or participate in answering them you must register for a free account. By registering you will be able to:
  • Get free answers from experts in any of our 300+ topics.
  • Accept money for answers that you provide.
  • Communicate privately with other members (PM).
  • See fewer ads.

Home > Computers & Technology > Programming > Other Programming   »   "kill" command in liberty basic

 
Question Tools Search this Question Display Modes
Question
 
 
#1  
Old Jan 3, 2007, 05:16 AM
rrr
Junior Member
rrr is offline
 
Join Date: Jan 2007
Posts: 92
rrr See this member's comment history on his/her Profile page.
"kill" command in liberty basic

it seems the "kill" cmd in liberty basi doesent work because files are interpreted as read only when trying to "kill" them. i tried making a un-install program with the kill cmd, but it didnt work. what to to???

Reply With Quote
 
     

Answers
 
 
Old Jan 3, 2007, 08:20 AM   #2  
LTheobald
Ultra Member
LTheobald is offline
 
LTheobald's Avatar
 
Join Date: Feb 2004
Location: Cambridge, UK
Posts: 1,047
LTheobald See this member's comment history on his/her Profile page.LTheobald See this member's comment history on his/her Profile page.
Call LTheobald via Skype™ Send a message via MSN to LTheobald
There might be an unload command for the file you are opening. E.g. loadbmp has a unloadbmp command to unload the file. What command are you using to load the file?

I got that from searching on the help a bit:
Liberty BASIC Online Help
  Reply With Quote
 
     
 
 
Old Jan 3, 2007, 11:15 PM   #3  
rrr
Junior Member
rrr is offline
 
Join Date: Jan 2007
Posts: 92
rrr See this member's comment history on his/her Profile page.
i guess you misinterpreted the command, you do not use the "kill" command when handling a file, then you use the close *filehandler*
kill is used in this way:

Code:
print "Enter a valid path for a file so that this program can erase it :)" input path$ kill$(path$)

Liberty basics helpfiles description:
Code:
KILL "filename.ext" This command deletes the file specified by filename.ext. The filename can include a complete path specification.

Even if path$ leads to a valid file, the file somehow turn into a read-only file. i tried to remove the read-only option, but it still didn't work. it turns out that it had gone back to being a read-only file.
and thanks for helping me!
if you are looking for a place to download liberty basic go here:
Liberty BASIC - Easy Programming for Windows
fun fact: i am thirteen
  Reply With Quote
 
     
 
 
Old Jan 11, 2007, 12:37 PM   #4  
Carl Gundel
New Member
Carl Gundel is offline
 
Join Date: Jan 2007
Posts: 2
Carl Gundel See this member's comment history on his/her Profile page.
Quote:
Originally Posted by rrr
it seems the "kill" cmd in liberty basi doesent work because files are interpreted as read only when trying to "kill" them. i tried making a un-install program with the kill cmd, but it didnt work. what to to???
The file delete command (like KILL) cannot delete read only files. You will probably need to use a function the Windows API to set the read only flag to false.

SetFileAttributesA looks like the right one.

Here's a short example:

Quote:
FileDialog "Select filename", "*.*", file$
Call ClearReadOnly file$
End

Sub ClearReadOnly File$
CallDLL #kernel32, "GetFileAttributesA", _
File$ As Ptr, _
attr As Long

If attr <> -1 Then ' check for valid file
If (attr And _FILE_ATTRIBUTE_READONLY) = 1 Then
attr = attr - _FILE_ATTRIBUTE_READONLY

CallDLL #kernel32, "SetFileAttributesA", _
File$ As Ptr, _
attr As Long, _
ret As Long
End If
End If
End Sub


-Carl Gundel, author of Liberty BASIC
Liberty BASIC - Easy Programming for Windows
  Reply With Quote
 
     
 
 
Old Jan 15, 2007, 02:02 AM   #5  
rrr
Junior Member
rrr is offline
 
Join Date: Jan 2007
Posts: 92
rrr See this member's comment history on his/her Profile page.
thank you very much, carl. it's a honor to have been helped by you
*bows deeply*
  Reply With Quote
 
     


Question Tools Search this Question
Search this Question:

Advanced Search
Display Modes

 
Similar Sponsors

Similar Questions
Question Asker Topic Answers Last Post
pink pill with "watson" and "502" on it lwagoner Medications 2 Jan 21, 2008 09:59 PM
Fan Blower not working in "ON" or "AUTO" in heat or AC phelixu Heating & Air Conditioning 4 Aug 4, 2007 08:43 PM
liberty basic "drawbmp" command is acting up rrr Other Programming 5 Jan 15, 2007 02:04 AM
Heater blows cold when "On", not at all on "Auto" mcdisney Heating & Air Conditioning 1 Nov 13, 2006 04:27 PM




Copyright ©2003 - 2007, Ask Me Help Desk.
All times are GMT -8. The time now is 01:37 PM.

Content Relevant URLs by vBSEO 3.0.0 RC6 © 2006, Crawlability, Inc.