Solved

GetPrivateProfileString  and  Apostrophes

Posted on 2006-06-13
3
425 Views
Last Modified: 2012-06-27
Im trying to use GetPrivateProfileString  to get 'TEST' from an INI but it keeps returning TEST  // notice there are no apostrophes.

Any ideas?

Thanks
0
Comment
Question by:tricks801
3 Comments
 
LVL 65

Accepted Solution

by:
rockiroads earned 500 total points
ID: 16895912
u tried

"'TEST'"

wrap it in single quotes?

or perhaps use

chr$(39 & "TEST" & chr$(39)


I think chr$(39) is '

0
 

Author Comment

by:tricks801
ID: 16896018
yes, but that wasnt an easy fix. Instead I use a replace when reading/writing to the ini...Replace(myString,"'", "`")
0
 
LVL 29

Expert Comment

by:nffvrxqgrcfqvvc
ID: 16896978
It shouldn't remove the characters from the buffer, post the code your using to get the values.
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction I needed to skip over some file processing within a For...Next loop in some old production code and wished that VB (classic) had a statement that would drop down to the end of the current iteration, bypassing the statements that were c…
Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

840 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question