Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

clear the file contens

5 REPLIES 5
Reply
Message 1 of 6
Anonymous
221 Views, 5 Replies

clear the file contens

i make 1 dialog box to display all text contens from 1 file *.txt and i just create 1 button for clear the text in that file to become emty file, i no ideal how to make the code can yours tell me how to do -- ---------------------------------------- Design/Engineering Dept.
5 REPLIES 5
Message 2 of 6
Anonymous
in reply to: Anonymous

;written by Mark Propst 2-24-04 ;for nalsur8 ;use with caution!!! (defun cleartextfile(filename / wfh) (if(setq filename(findfile filename)) (progn (setq wfh(open filename "w"));open for write overwrites contents (if wfh (close wfh));don't write anything, just close- that saves file and is now blank (setq wfh nil) ) ) ) "nalsur8" wrote in message news:403bf741_3@newsprd01... > i make 1 dialog box to display all text contens from 1 file *.txt and i just > create 1 button for clear the text in that file to become emty file, > i no ideal how to make the code can yours tell me how to do > > > -- > ---------------------------------------- > Design/Engineering Dept. > >
Message 3 of 6
Anonymous
in reply to: Anonymous

file is empty but the list_box still have text when i click the button Clear when i run again for 2nd time the list_box is empty -- ---------------------------------------- Design/Engineering Dept. Mark Propst wrote in message news:403c30cc$1_1@newsprd01... > ;written by Mark Propst 2-24-04 > ;for nalsur8 > ;use with caution!!! > (defun cleartextfile(filename / wfh) > (if(setq filename(findfile filename)) > (progn > (setq wfh(open filename "w"));open for write overwrites contents > (if wfh (close wfh));don't write anything, just close- that saves > file and is now blank > (setq wfh nil) > ) > ) > ) > > > "nalsur8" wrote in message news:403bf741_3@newsprd01... > > i make 1 dialog box to display all text contens from 1 file *.txt and i > just > > create 1 button for clear the text in that file to become emty file, > > i no ideal how to make the code can yours tell me how to do > > > > > > -- > > ---------------------------------------- > > Design/Engineering Dept. > > > > > >
Message 4 of 6
BillZ
in reply to: Anonymous

nalsur8 ,
To clear a list in a dialog box using a button.
You need to put an action_tile in the lisp:
(action_tile "button_key" "(mysubr)")

Then, in the file before the lisp, define the function:
(defun mysubr () ;clears dialog box.
(start_list "list_key")
(end_list)
)
Start_list will by default create a new list which will be blank if you don't add anything to it.

HTH

Bill


Message was edited by: BillZ
Message was edited by: BillZ
Message 5 of 6
Anonymous
in reply to: Anonymous

ok i get it thank you -- ---------------------------------------- Design/Engineering Dept. BillZ wrote in message news:7406648.1077797300097.JavaMail.javamailuser@localhost... > nalsur8 , > To clear a list in a dialog box using a button. > You need to put an action_tile in the lisp: > (action_tile "button_key" "(mysubr)") > > Then, in the file before the lisp, define the function: > (defun mysubr () ;clears dialog box. > (start_list "list_1") > (end_list) > ) > Start_list will by default create a new list which will be blank if you don't add anything to it. > > HTH > > Bill > > > Message was edited by: BillZ >
Message 6 of 6
BillZ
in reply to: Anonymous

You're welcome.

Glad I could help.


Bill

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost