Home AMX Forum AMX General Discussion
Options

Apostrophe's in arrays?

How do you go about getting apostrophe's in an array to work?
 'Master Suite Windows',     	//69 //5
     'Gallery Stairs Windows',   	//70 //6
     'Back Bedroom Windows',  		//71 //7
     'Front Bedroom Windows',     	//72 //8
     'Corner Bedroom Windows',      	//73 //9
     "'Kid',39,'s Playrm Wndws'",  	//74 //10
     "'Nanny',39,'s Room Wndws'",       //75 //11
     'Spa/Exercise Windows',         	//76 //12
     '3rdFL Bedrooms Windows',      	//77 //13
     'Laundry Water Bug',   		//78 //14
     'AC Pits Water Level',              //79 //15
     '**'      				//80 //16
     }   

    

The above doesn't seem to work, although they work fine when not in the array.

Comments

  • ericmedleyericmedley Senior Member - 3709 Posts
    " 'Welcome To Jen',$27,'s Room' " // $27 is an apostrophe

    This yields "Welcome to Jen's Room"
  • viningvining X Member
    ericmedley wrote:
    " 'Welcome To Jen',$27,'s Room' " // $27 is an apostrophe
    That's just the same thing as using decimal 39. In a string all by itself it works fine but in the array of strings I'm using for security zones I would get compiler errors because the compiler would think I had more characters than the array was sized for and in the example shown I actually get the entire string dispalyed on the TP showing 39. In my editor is it's display as a decimal since I have my double and single quotes where they belong, so I don't get it.
  • Dan ColegroveDan Colegrove Junior Member
    Try this

    "'Kid''s Playrm Wndws'", //74 //10

    You can use back to back apostrophes to tell the system to print and or compile a single apostrophe.

    Hope this helps!

    Dan
  • jjamesjjames AMX Sustaining Engineer
    "'Kid''s Playrm Wndws'", //74 //10

    You can use back to back apostrophes to tell the system to print and or compile a single apostrophe.

    Hope this helps!

    Dan

    This is exactly what I do. Was about to suggest it, but ya beat me to it! :D
  • ericmedleyericmedley Senior Member - 3709 Posts
    vining wrote: »
    ericmedley wrote:

    That's just the same thing as using decimal 39. In a string all by itself it works fine but in the array of strings I'm using for security zones I would get compiler errors because the compiler would think I had more characters than the array was sized for and in the example shown I actually get the entire string dispalyed on the TP showing 39. In my editor is it's display as a decimal since I have my double and single quotes where they belong, so I don't get it.

    Sorry, didn't read far enough.. :)

    I think you can put two apostrophes in the place of one and the complier knows that to mean "i want an apostrophe here please' Or you can just declare the variable and populate it in the DEFINE_START by using the dec 39 or hex $27.
  • viningvining X Member
    Thanks guys! I knew other languages allowed that and pretty sure I've tried it with Netlinx as well but obviously what I tried was wrong so I gave up.
  • John GonzalesJohn Gonzales Junior Member
    The back to back apostrophes work, and you don't need the double quotes for the string. This is what I use and it works fine:
    CHAR sZoneNamesArray[128][37] =	
      {
    	 'Jacqueline''s Office Sliding Door',					//Zone 1
    	 'Jacqueline''s Office Window',						//Zone 2
    	 'Jacqueline''s Office Motion',						//Zone 3
    	 'Conservatory Entry Door (Left)',					//Zone 4
    	 'Conservatory Entry Door (Right)'					//Zone 5
      }		
    

    --John
Sign In or Register to comment.