SWI Prolog , how to assert data to txt file -


This is my sample source code, I am using SWI Prolog, can someone tell me how to data To be implemented in which the user's key txt.file I want to save the data in txt.file.

Start: -display_menu

Write ('\ n1. User Information Enter'), type ('\ n0.exits'), enter ('\ n enter your choice:'), read (choice), selection (choice), choice = 0

Selection (1): - get_userinfo.

Selection (0): -!

get_userinfo: -write ('\ n * enter user information '),

  ('\ nEnter the name:' Write (name), write ('\' gender: ''), read (gender), write ('\' enter age: '), read (age), no (age group) ('\ NGet properties'), get_attribute (attr), emphasis (userInfo (name, gender, age, aTTR)).   

get_attribute: - type ('enter height \'),

  read (height), attr = [height].   

Age (age): - Age & lt; 18, write ('enter valid age.').

check; You probably want to open / close 3 and close / use one file to open / close and write / 2.

Like:

  open ('myfile.txt)', write, s), write (s, data), stop (s).    

Comments

Popular posts from this blog

mysql - BLOB/TEXT column 'value' used in key specification without a key length -

c# - Using Vici cool Storage with monodroid -

python - referencing a variable in another function? -