o
k
q
u
e
s
t
i
o
n
s
.
c
o
m

*RESOLVED * String Comparison Problem -

I have stored the names of two printers in an INI using WritePrivateProfileString. I read them back into two strings using GetPrivateProfileString. I then want to set the printer to the name of one of those strings:

Dim prn As Printer
Dim str As String

For Each prn In Printers
str = prn.DeviceName
If Name$ = str$ Then MsgBox "Success": Exit For
MsgBox Name$
MsgBox str$
Next

The problem is that both Name$ and String$ are exactly the same in the MsgBoxes but my success condition never fires. Do i need to do some special formating to get a loaded INI string to match a Printer DeviceName string?

Solution:
Ret$ = Space(255)
Call GetPrivateProfileString("Printers", "FullPage", "", Ret$, 255, IniFile$)
Ret$ = Left(Ret$, Len(Trim$(Ret)) - 1)
fpPrinter$ = Ret$

 

Resource Manager - Case Sensitive String Comparison (Resolved) -
Hi there, I havent posted on this site for quite a while... sorry... I have a question, is it quicker to perform a case sensitive string comparison rather than a non cases sensitive comparison. I have a resource file that contains quite a few strings, could i optimize access spe


Best comparison algorith -
Hello, Can anyone suggest an algorithm to read a disk file and compare each record to another string? I was thinking of reading the disk file into a new Collection, then doing a keyed comparison to the other String. Does this sound flakey guys? My concern is to use a routine t


Listview Sort -
Hi all, I'm trying to sort a list view control, but I don't want it sorted using string comparison. I know that a callback function can be used for comparison, but I don't seem to be able to make it work. Some code would be very helpfull, thanks a lot.


*RESOLVED * String Comparison Problem -
I have stored the names of two printers in an INI using WritePrivateProfileString. I read them back into two strings using GetPrivateProfileString. I then want to set the printer to the name of one of those strings: Dim prn As Printer Dim str As String For Each prn In Printers


Once again, sorting pb -
Hi all. I've searched the past threads about sorting and even though there are many existing resolved threads, none address my problem. So let me explain: Hi need to sort strings in an array. Nothing to fancy yet. But my problem is that some of the values I need to sort are ac


I'm Back! - Need Help w/ String Comparison -
Hey Everybody! Its been a long time since ive been at these forums, but the time of return has finally arrived. I just started doing C++ very recently (in fact, about 4.5 days ago) and I was looking to do string comparison as part of a little beginner project. My question i


Need to know a shortcut for string comparison -
I have an array of string for e.g. strarr={"A1", "B1", "C1", "D1" ) I want to match a string variable from another similar string array with strarr. In order to minimize the processing time I wanted to do it as follows instead of a for loop.:


comparison between ASP and JAVA servlet techonlogy -
Hello All, Can you give me the comparison between ASP and JAVA servlet techonlogy , i 'm preparing for a presentation i have to describe the diffrence between ASP and JAVA so anybody who knows the above please tell me the same comparison based on technology , speed, performance


how to do time comparison in VB -
i have a problem in time comparison. i want to compare system time with given fixed time & want to get result in hh:mm:ss format. plz help..............


[2005] Declare < > (less/greater than) -
Hi! How do i declare a less than or greater operator? (if thats the correct wording) For example: Code: Private Sub Compare_Values() Dim Comparison as _____?? Comparison = < '// Comparison operator will be a variable set by the user input '// it will either be le


VB6 -- Find all differences between two strings/files (FAST). -
Just a module that I cooked up for doing string/file comparison. Pass it two strings, and it returns a comma delimited string of character positions that are unmatched in the other string. So, to get all changes (insertions and deletions) it would need to be called twice. For exampl


Learning and Comparing various Hardware -
Just recently, I've been asked to become computer hardware advisor. I, being a software consultant for most of my life, have virtually no knowledge in computer hardware. Is there any site that compares various brands of printers, scanners, multifunction machines, etc. I'm more concered


Problem with string comparison -
Hello, The code i want to implement is like this: compare last characters of a string, which are .c" to a given string and perform operations as per that. My problem is that when i try to use the code: if right(str) = ".c"" then ....... i get an erro


[RESOLVED, feedback to come][2005] Synching two RTB scroll bars -
A bit of an extension on my string comparison program.. Both RTB's are set with both scrollbars. They both focus simultaneously, so when an error is located, they both jump to the same position. However, I'd like to add to that by locking the scroll bars of both RTB's together so w


which is greater -
hi all , i want to perform comparison between two variable and find out which is greater without using comparison operator. give me suitable answer, regards, abhishek mishra


XML comparison -
Hi, I have two XML files needed to compare to indicate whether they are same. The comparison focuses on the Data inside the two xml files. the tag sequence could be different. Thanks for help Robert


image comparison algorithm -
does anyone know of any image comparison algorithms that can compare two black + white images? -C


Excel cell comparison with listbox value -
Hi there, another simple one from Simple Si... I have a list box lstInverterModel whose items are a list of Excel cells with a string like "Trace, SW2024E, 2000" in them. I need to do an IF comparison of the value of lstInverterModel.Value with the cells where the list


Option Compare Database -
I want my database to by default use binary comparison, not text comparison. Anybody know how to do that?


Class Module Comparison.[Resolved, kinda] -
What's the easiest way to tell if all variables in two class modules are the same?


Help on comparison problem -
Hi, I'm using ADO2.1 + SQL7 before, and everything is fine. Until now, SQL server is upgraded to SQL2K, and now I met a problem on field with "char" datatype. When inserting a value (e.g. "ABC") to a say char(5) field, sql2k will pad space to the field automa


More comparison -
Hi again Now it's a different type of comparison: A B C D E F A B C I want to get the highest letter in cell A1, that'll say I want the value of D2. But it has to get the value in E2 if the letter D is there and in B2 the letter A. I've tried with some i


String cast to double -
I had a class with a public integer member in it. At one point, I had a line such as this: If class.theinteger = 0 then However, I realized that the field couldn't simply be an integer, so I changed it to a string without altering the above line of code. Naturally, that line of


Date and Time comparison -
Guys, Heres what i want to do. I have a logging program that records the date and time a process was started and also logs the date and time of when it completed. What i want to do is compare these values to get an elapsed time for the process. Because the logging program writes


Simple bit comparison routine HELP! -
Could anyone possibly suggest a simple routine / procedure that would take two files and do a complete comparison on a bit to bit basis? I am VERY rusty with VB, so the simpler the better please! Many thanks. Ben.


Bitwise String comparison -
I have some data which I can represent in a binary format. It's basically a long array of data which is either positive or negative values. I want to be able to do a comparison against another array of smaller size to check for places where the two can overlap. So let's say I represe


DateTime Comparison -
Hi all, I am using vb and ado to retrieve data from sql server. I retrieve a datatime field from a table and store it in a recordset. The value of that datetime field stored in recordset misses the milliseconds. I will use this field to do some comparison with the datetime fi


Mid or Mid$ -
I am don't a whole bunch of string comparison (for making a crossword)... should I use mid or mid$ ???


cin and string problem [resolved] -
When i use cin it doesnt put any of the spaces into the string. Another thing, how would i get the text that was entered after the space in the string and put that in a seperate string. Think of how dos parameters after a command work, thats kinda what im trying to do.


Price Comparison -
Hi, there. I have a page that show price and productid, also checkbox to choose to compare. how can i send parameter to another php page as array? any better way? any one has any example of price comparison (PHP) ? thanks for advance


Comparison of Double values -
I encounter a strange problem when comparing two double numbers. The code is below and it gave me "1.4>1.4"! Anything speical for such simple comparison? Thanks. ---------------------------------------------------------- Dim aa1 As Double Dim aa2 As Double


MSChart Features... -
can anyone listm e what mschart can do and the type of charts that it can produce? i know there are so many third party component that far more better than mschart, even i use non-vb chart component in my project. but this is just for my own comparison,i'm doing charting tools comparis


Login Form using an ACCDB File -
Sorry if I missed this in my search, but I am having trouble with this for my course. I want to create a login form the will lookup the entry for comparison in an access 2007 db. My Current DB has 4 tables. I was able to look up how to establish the connection, but I am unable to lo


what is the syntax for string comparison -
hi, I have a datareader that reads all my records then I want to filter only for cetain values this is what I have but I get " End of statement expected" --------------------------------- dim ids as string ids = "1,2,5,9,8,54,52,14,1" If dtrReport("ID&q


Code comparison software -
Can anyone recommend any code comparison software (commercial or non-commercial)? Features should include: Showing of New & Deleted Lines Modified areas in code New files added would be a bonus The standard stuff... Thanks.


Vbnewline and vbcrlf problem by converting to Hex - RESOLVED -
HI! I’m trying to convert a formatted string to Hex. It seems to going well. I’m getting problem with the format “vbNewLine” and “vbCrLf” both represented inside the string with “”. Their Ascii values are “13” and “10”. I read that this character () is no


VB.NET comparison with Java -
With VB.NET offering so much new facilities like inheritence, structured error handling, polymorphism, java style syntax, easy database connectivity and much more.... what do you think about the comparison VB.NET vs. Java? Do you think VB.NET will give Java programmers a run for the


[2008] ActiveX - Affiliate linking -
hello! im thinking about creating a price comparison site, im after an activeX control much like this one http://www.cashbackwow.co.uk/rebate_catcher.php What i want is an activeX control that makes the site that the user is on, say amazon, think that they have been directed to that


(SOLVED) 2 DB comparison... -
Hi... I have a simple question but I'm kind of clueless on how to do it (And I couldnt' find any information here relating to that). There is a way of make a full comparison of a table between two DB in one Query?... (The 2 DB are the "same" but because they are in di


Java vs C# code-for-code comparison -
Interesting article, although the comparison was done with Beta1 .NET http://www.extremetech.com/article/0...16&ap=1,00.asp