Author Topic: possessive case in a line of text  (Read 14932 times)

shankle

  • Member
  • ****
  • Posts: 835
possessive case in a line of text
« on: July 26, 2013, 06:55:07 AM »
In a line of text a word such as "inversion''s" causes the 1st letter of the line of text
not to print. Ex: derived shows as erived. Where in the documentation is this explained?
I only count the 2 ticks as one. If I increase it by 1 that does not solve the problem.

Yuri

  • Member
  • **
  • Posts: 175
Re: possessive case in a line of text
« Reply #1 on: July 26, 2013, 03:06:50 PM »
I was unable to reproduce this. Can you provide any code that shows the bug?

shankle

  • Member
  • ****
  • Posts: 835
Re: possessive case in a line of text
« Reply #2 on: July 26, 2013, 08:44:13 PM »
Thanks Yuri for responding.
Hope this helps to solve the problem.

Text line as coded.
T10    db   'derived. The 2nd INVERSION''S 1st note is G (5th note of the C scale). The 2nd  ',0

Code to execute the above line.
    invoke TextOut, [hdc],10,215,addr T10,79       

This is what displays on the screen.   
    erived. The 2nd INVERSION''S 1st note is G (5th note of the C scale). The 2nd

Yuri

  • Member
  • **
  • Posts: 175
Re: possessive case in a line of text
« Reply #3 on: July 27, 2013, 12:07:38 AM »
Yes, now I can see the effect. As it follows from the examples in the manual, you can use single quotes within a string only if the string is in double quotes, and vice versa. Or you have to use character codes instead of literal quote characters. The character code for the single quote is 27h.
Code: [Select]
T10    db   'derived. The 2nd INVERSION',27h,'S 1st note is G (5th note of the C scale). The 2nd  ',0

shankle

  • Member
  • ****
  • Posts: 835
Re: possessive case in a line of text
« Reply #4 on: July 27, 2013, 05:00:05 AM »
Thank you Yuri.
That fixed it.
I guess the answer is in the GoAsm docs but where?

Yuri

  • Member
  • **
  • Posts: 175
Re: possessive case in a line of text
« Reply #5 on: July 27, 2013, 12:33:01 PM »
Basic GoAsm elements -> Data declaration -> Declaring strings + Declaring more than one string per line

wjr

  • Member
  • **
  • Posts: 209
    • WJR's website
Re: possessive case in a line of text
« Reply #6 on: July 30, 2013, 11:21:28 AM »
At first glance, that looked like a double quote in the middle, in which case it should have worked (although you wanted the double and single quotes swapped). What you had was two single quotes there, and for that GoAsm probably should have given an error message instead of an error.

Your problem has been solved, but I shall still add this to the list of things to look into when I get a chance...

shankle

  • Member
  • ****
  • Posts: 835
Re: possessive case in a line of text
« Reply #7 on: August 16, 2013, 12:59:31 PM »
This is another example that I am having trouble with in GoAsm.
No error is given but the program stalls.
Neither datestring works.

datein             db   12 DUP (0)
datestring       db   "MM'-'dd'-'yyyy",0
datestring       db   "MM-dd-yyyy",0

    invoke GetDateFormat, NULL, 0, NULL, addr datestring, addr datein,12

Suggestions for where to read about it would be most appreciated.

wjr

  • Member
  • **
  • Posts: 209
    • WJR's website
Re: possessive case in a line of text
« Reply #8 on: August 16, 2013, 02:54:27 PM »
The second datestring looks like the one that you want to use, and what you have shown should work. If it doesn't then the problem is elsewhere. One possibility, it looks like you are intending to use an ANSI string, so if you have defined the symbol UNICODE and/or used STRINGS UNICODE, that will throw things off (if so for both, use DUS instead of db for the strings so that they are UNICODE).

dedndave

  • Member
  • *****
  • Posts: 8823
  • Still using Abacus 2.0
    • DednDave
Re: possessive case in a line of text
« Reply #9 on: August 16, 2013, 08:06:38 PM »
give this a try, Jack

Code: [Select]
;###############################################################################################

        .XCREF
        .NoList
        INCLUDE    \Masm32\Include\Masm32rt.inc
        .List

;###############################################################################################

        .DATA

szTitle     db         'GetDateFormat',0
szFormat    db         'MM-dd-yyyy',0

;***********************************************************************************************

        .DATA?

stLocalTime SYSTEMTIME <>
szBuffer    db         12 dup(?)

;###############################################################################################

        .CODE

;***********************************************************************************************

_main   PROC

        INVOKE  GetLocalTime,offset stLocalTime
        INVOKE  GetDateFormat,LOCALE_USER_DEFAULT,NULL,offset stLocalTime,
                offset szFormat,offset szBuffer,sizeof szBuffer
        INVOKE  MessageBox,NULL,offset szBuffer,offset szTitle,MB_OK
        INVOKE  ExitProcess,0

_main   ENDP

;###############################################################################################

        END     _main

it's MASM syntax, but you can convert it   :P

shankle

  • Member
  • ****
  • Posts: 835
Re: possessive case in a line of text
« Reply #10 on: August 16, 2013, 08:45:56 PM »
Thanks guys for responding.
I commented out the "GetDataFormat" and the program worked fine.
So neither string I used worked.
I am not doing anything with Unicode.
Could it be a header problem with GoAsm??
I use this same code in Masm32 and it works there.
I read in the manual about strings and could find nothing that applies to my problem.
I have two other programs with the same problem  - "GetDateFormat"
« Last Edit: August 16, 2013, 11:41:09 PM by shankle »

wjr

  • Member
  • **
  • Posts: 209
    • WJR's website
Re: possessive case in a line of text
« Reply #11 on: August 17, 2013, 08:36:53 AM »
The above, although just a small snippet, tested fine at this end with Donkey's headers. If the return value from GetDateFormat is non-zero and the string in datein is what you expected, then the problem is elsewhere in what you do with this date string...

shankle

  • Member
  • ****
  • Posts: 835
Re: possessive case in a line of text
« Reply #12 on: August 17, 2013, 11:45:16 AM »
I am running Windows 7. Microsoft says I should use GetDateFormatEx with that OS.
What is the header name that contains this API? I want to check to see if it is included in my
GoAsm headers.


Yuri

  • Member
  • **
  • Posts: 175
Re: possessive case in a line of text
« Reply #13 on: August 17, 2013, 01:10:19 PM »
You don't need any special header. On my Windows 7, both GetDateFormat and GetDateFormatEx work as expected. Only windows.h is included.

shankle

  • Member
  • ****
  • Posts: 835
Re: possessive case in a line of text
« Reply #14 on: August 17, 2013, 10:06:22 PM »
Hi Yuri,
Would you kindly give an example as mine still does not work?