GetPrivateProfileString 
Author Message
 GetPrivateProfileString

Ok,  I give up...  Does anyone out there have a small routine that calls
GetPrivateProfileStrings to an INI file that they could e-mail me?  This
would be greatly appreiaceated as I am almost complete with this
application, except that I need to read and write to an INI file.  I have
done this a thousand time from VB, but just can't seem to get powerbasic CC



Thu, 07 Jun 2001 03:00:00 GMT  
 GetPrivateProfileString
[A copy of this message was sent to the cited author.]


Quote:
> Ok,  I give up...  Does anyone out there have a small routine that calls
> GetPrivateProfileStrings to an INI file that they could e-mail me?  This
> would be greatly appreiaceated as I am almost complete with this
> application, except that I need to read and write to an INI file.  I have
> done this a thousand time from VB, but just can't seem to get PowerBasic CC
> to do it.  Thanks, Joe:)

'=============================================================================
'
'  EZ Count CGI Application for PowerBASIC Console Compiler
'  Copyright (c) 1998 by Dave Navarro, Jr.
'
'  Usage:
'
'  You are visitor number: <!--#exec cgi="/cgi-bin/ezcount.exe?countername"-->
'
'=============================================================================

$DIM ALL
$INCLUDE "WIN32API.INC"

'=============================================================================

FUNCTION PbMain ()

  LOCAL IniFile   AS ASCIIZ * 256
  LOCAL count     AS ASCIIZ * 16
  LOCAL counterId AS ASCIIZ * 64
  LOCAL e         AS LONG

  counterId = TRIM$(COMMAND$)

  IF LEN(CounterId) = 0 THEN
    STDOUT "<B>Error! No Counter ID specified</B>";
    EXIT FUNCTION
  END IF

  count = "1"

  GetModuleFilename 0, IniFile, SIZEOF(IniFile)
  IniFile = UCASE$(IniFile)

  REPLACE ".EXE" WITH ".INI" IN IniFile

  GetPrivateProfileString "EZ Counter", counterId, "0", count, SIZEOF(count),
IniFile

  count = FORMAT$(VAL(count)+1)

  WritePrivateProfileString "EZ Counter", counterId, count, IniFile

  STDOUT FORMAT$(VAL(count),",");

END FUNCTION



Fri, 08 Jun 2001 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. GetPrivateProfileString

 

 
Powered by phpBB® Forum Software