March 20th, 2011, 03:46 AM
#1
Type Mismatch issue
why i am getting type mismatch error in the following code ??? . kindly let me know the idea . any help would be highly appreciated !!!
Code:
Print #1, rs!QTY + "," + "",
Print #1, rs!Price + ","
Last edited by firoz.raj; March 20th, 2011 at 07:30 AM .
March 20th, 2011, 10:10 AM
#2
Re: Type Mismatch issue
You should use the ampersand '&' instead of the plus +' when concatenating strings.
March 20th, 2011, 10:42 AM
#3
Re: Type Mismatch issue
You should use the ampersand '&' instead of the plus +' when concatenating strings.
Code:
Print #1, "Saudi Arabia ", " """,
Print #1, Day(Now); "," + "",
Print #1, Format(Now, "mmm"); "," + "",
Print #1, Year(Now); "," + "",
Print #1, rs!STOREID & "," + "",
Print #1, rs!itemid & "," + "",
Print #1, rs!serial1 & "," + "",
Print #1, rs!serial2 & "," + ""
Print #1, rs!QTY & "," + "",
Print #1, rs!Price & "," + ""
Attached Files
March 20th, 2011, 11:06 AM
#4
Re: Type Mismatch issue
I see + signs, still...
Code:
Print #1, "Saudi Arabia ", " """,
Print #1, Day(Now); "," + "",
Print #1, Format(Now, "mmm"); "," + "",
Print #1, Year(Now); "," + "",
Print #1, rs!STOREID & "," + "",
Print #1, rs!itemid & "," + "",
Print #1, rs!serial1 & "," + "",
Print #1, rs!serial2 & "," + ""
Print #1, rs!QTY & "," + "",
Print #1, rs!Price & "," + ""
March 21st, 2011, 12:23 AM
#5
Re: Type Mismatch issue
Originally Posted by
dglienna
I see + signs, still...
Code:
Print #1, "Saudi Arabia ", " """,
Print #1, Day(Now); "," + "",
Print #1, Format(Now, "mmm"); "," + "",
Print #1, Year(Now); "," + "",
Print #1, rs!STOREID & "," + "",
Print #1, rs!itemid & "," + "",
Print #1, rs!serial1 & "," + "",
Print #1, rs!serial2 & "," + ""
Print #1, rs!QTY & "," + "",
Print #1, rs!Price & "," + ""
Yep lot's of em
while + will work in many cases the & is the way to go, it always works and makes the code much easier to understand at a quick glance.
also have no idea why this type of thing is even there
Code:
Print #1, rs!serial1 & "," + "",
Print #1, rs!serial2 & "," + ""
Adding an empty string to the end in these cases will do absolutely nothing beyond making the program slightly slower and require more time fromt he programmer who typed the extra characters into the editor.
"," + "" = "," btw
Also looks like there is a comma missing after serial2
Always use [code][/code] tags when posting code.
March 21st, 2011, 12:59 AM
#6
Re: Type Mismatch issue
I see + signs, still... Code:
Print #1, "Saudi Arabia ", " """, Print #1, Day(Now); "," + "", Print #1, Format(Now, "mmm"); "," + "", Print #1, Year(Now); "," + "", Print #1, rs!STOREID & "," + "", Print #1, rs!itemid & "," + "", Print #1, rs!serial1 & "," + "", Print #1, rs!serial2 & "," + "" Print #1, rs!QTY & "," + "", Print #1, rs!Price & "," + ""
where + sign is missing ???.kindly put some color over it !!!!!!!!!!!.
March 21st, 2011, 01:32 AM
#7
Re: Type Mismatch issue
Go back and read it again...
You should use the ampersand '
& '
instead of the plus
+' when concatenating strings.
Posting Permissions
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
Forum Rules
Click Here to Expand Forum to Full Width