It is currently Tue Mar 19, 2024 4:04 am


All times are UTC - 8 hours [ DST ]




Post new topic Reply to topic  [ 1 post ] 
Author Message
 Post subject: MUMPS routine for reading INI files
PostPosted: Wed Feb 20, 2013 10:22 pm 
User avatar

Joined: Mon Nov 01, 2010 1:39 pm
Posts: 51
Real Name: John Willis
Began Programming in MUMPS: 01 Apr 2010
Here's a MUMPS routine for reading INI files in the following format:

[Section]
key1=value1
key2=value2

Code:
KBBMINI ;CLD/JOLLIS-INI FILE TOOLS ;8:58 PM 2-20-2013
 ;;0.1;CLIME;****;Feb. 20, 2013

STRGET(FILE,SECTION,KEY)
 N LINE,SECMAT,INSEC,RETVAL S SECMAT="["_SECTION_"]"
 S INSEC=0 S RETVAL=""
 O FILE:(READONLY)
 F  K LINE U FILE R LINE Q:$ZEOF  D
 .I LINE[SECMAT S INSEC=1
 .I INSEC=1 D
 ..S TMPKEY=$P(LINE,"=",1)
 ..I TMPKEY=KEY S RETVAL=$P(LINE,"=",2)
 C FILE
 U $P
 Q RETVAL


FILE must contain the full path to the INI file.

_________________
John Willis, Founder
Coherent Logic Development
http://youngmumpster.wordpress.com/
jwillis@coherent-logic.com


Top
Offline Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC - 8 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
Theme created StylerBB.net