Author Topic: Help with a Compliation error  (Read 3461 times)

0 Members and 1 Guest are viewing this topic.

Offline Cobalt

  • QB64 Developer
  • Forum Resident
  • Posts: 878
  • At 60 I become highly radioactive!
    • View Profile
Help with a Compliation error
« on: June 07, 2021, 02:09:19 pm »
Can anybody see what I am doing wrong to get this error? this is with 1.5 (3043116) (and 1.4)
"In file included from qbx.cpp:2216:
..\\temp\\main.txt: In function 'void QBMAIN(void*)':
..\\temp\\main.txt:599:101: error: lvalue required as unary '&' operand
 sub_put( 1 ,NULL,byte_element((uint64)(&(qbs_new_fixed(&((uint8*)(__ARRAY_STRING5_D[0]))[(0)*5],5,1))),(5*(__ARRAY_STRING5_D[2]&1)*__ARRAY_STRING5_D[5])-(5*(0)),byte_element_45),0);
                                                                                                     ^
compilation terminated due to -Wfatal-errors.
"

heres the code, and the TXT file it accesses below
it errors out when I try to save the array D() in the line: PUT #1, , D()
remark that line out and it works fine.
Code: QB64: [Select]
  1. TYPE Monsters
  2.  Nam AS STRING * 8 '     Monster name
  3.  Hp AS _UNSIGNED _BYTE ' Health
  4.  MHp AS _UNSIGNED _BYTE ' Health
  5.  Atp AS _UNSIGNED _BYTE ' Attack Power
  6.  Dfp AS _UNSIGNED _BYTE ' Defence Power
  7.  Exp AS _UNSIGNED _BYTE ' Experiance
  8.  Mes AS _UNSIGNED _BYTE ' Meseta(gold)
  9.  Num AS _BYTE '           How many show up
  10.  Flee AS _UNSIGNED _BYTE 'Difficulty in running away (0-255 where 0 is bad)
  11.  Trap AS _BYTE '          is their treasure trapped (0-255 where 0 is good)
  12.  Kind AS _UNSIGNED _BYTE 'Kind of trap(arrow or blast)
  13.  Drop AS _BYTE '          Item Dropped if any
  14.  Odds AS _UNSIGNED _BYTE 'How likey to drop item (0-255 where 0 is no drop)
  15.  Talk AS _BYTE '          can talk to normally
  16.  Chat AS _BYTE '          can talk to magically
  17.  Rope AS _BYTE '          can use rope against
  18.  Prot AS _BYTE '          can use protect against
  19.  Myst AS _BYTE '          mystery???
  20.  Special AS _BYTE '       special attack(rope,cure,fire,ect)
  21.  
  22. TYPE Items
  23.  Nam AS STRING * 8
  24.  Pwr AS _BYTE
  25.  Cost AS INTEGER
  26.  Alis AS _BYTE
  27.  Myau AS _BYTE
  28.  Odin AS _BYTE
  29.  Noah AS _BYTE
  30.  CanSell AS _BYTE
  31.  CanDrop AS _BYTE
  32.  Is_Type AS _BYTE
  33.  
  34. TYPE PlayerLeveling
  35.  HitPts AS _UNSIGNED _BYTE
  36.  AttVal AS _UNSIGNED _BYTE
  37.  DefVal AS _UNSIGNED _BYTE
  38.  MagPts AS _UNSIGNED _BYTE
  39.  Combat AS LONG
  40.  NonCbt AS LONG
  41.  
  42. TYPE WorldTiles
  43.  Is_Walkable AS _BYTE
  44.  Is_Animated AS _BYTE
  45.  Encounter_Group AS _BYTE 'what types of creature encounters possible
  46.  Is_Village AS _BYTE
  47.  Is_Cave AS _BYTE 'Covers all Cave-like locations
  48.  Display_Layer AS _BYTE '
  49.  
  50. TYPE TownTiles
  51.  Is_Walkable AS _BYTE
  52.  Is_Animated AS _BYTE
  53.  Is_NPC_Location AS _BYTE 'where the NPCs stand
  54.  Is_Building AS _BYTE 'covers shops and houses
  55.  Is_Exit AS _BYTE
  56.  
  57. TYPE Spells
  58.  Nam AS STRING * 4
  59.  Cost AS _BYTE
  60.  
  61. TYPE KeyCodeData
  62.  Nam AS STRING * 8
  63.  Value AS LONG
  64.  
  65. TYPE PlayerSpellList
  66.  link AS _BYTE
  67.  
  68.  
  69. DIM SHARED M(74) AS Monsters, Pl(3, 30) AS PlayerLeveling, I(64) AS Items
  70. DIM SHARED S(18) AS Spells, PSL(3, 1, 4) AS PlayerSpellList
  71. DIM SHARED Line$(1500), D(3) AS STRING * 5
  72. DIM SHARED KeyCodes(134) AS KeyCodeData
  73. DIM SHARED TownMap(9, 54, 39) AS TownTiles '_UNSIGNED _BYTE
  74. DIM SHARED Map(128, 96) AS WorldTiles '_UNSIGNED _BYTE
  75.  
  76. ' _KEYHIT Keyboard Codes
  77. '
  78. 'Esc  F1    F2    F3    F4    F5    F6    F7    F8    F9    F10   F11   F12   Sys  ScL Pause
  79. ' 27 15104 15360 15616 15872 16128 16384 16640 16896 17152 17408 34048 34304 +316 +302 +019
  80. '`~  1!  2@  3#  4$  5%  6^  7&  8*  9(  0) -_ =+ BkSp   Ins   Hme   PUp   NumL   /     *    -
  81. '126 33  64  35  36  37  94  38  42  40  41 95 43   8   20992 18176 18688  +300  47    42   45
  82. ' 96 49  50  51  52  53  54  55  56  57  48 45 61
  83. 'Tab Q   W   E   R   T   Y   U   I   O   P  [{  ]}  \|   Del   End   PDn   7Hme  8/?   9PU   +
  84. ' 9  81  87  69  82  84  89  85  73  79  80 123 125 124 21248 20224 20736 18176 18432 18688 43
  85. '   113 119 101 114 116 121 117 105 111 112  91  93  92                    55    56    57
  86. 'CapL   A   S   D   F   G   H   J   K   L   ;:  '" Enter                   4/?-   5    6/-?
  87. '+301  65  83  68  70  71  72  74  75  76   58  34  13                    19200 19456 19712  E
  88. '      97 115 100 102 103 104 106 107 108   59  39                    52    53    54   n
  89. 'Shift   Z   X   C   V   B   N   M   ,<  .>  /?    Shift       ?           1End  2/?   3PD   t
  90. '+304    90  88  67  86  66  78  77  60  62  63    +303      18432        20224 20480 20736  e
  91. '       122 120  99 118  98 110 109  44  46  47                             49    50    51   r
  92. 'Ctrl   Win  Alt     Spacebar      Alt  Win  Menu  Ctrl   ?-    ?   -?      0Ins       .Del
  93. '+306  +311 +308        32        +307 +312 +319   +305 19200 20480 19712   20992     21248  13
  94. '                                                                            48         46
  95. '
  96. '     Lower value = LCase/NumLock On __________________ + = add 100000
  97.  
  98. KeyCodesData:
  99. DATA "ESC",27,"F1",15104,"F2",15360,"F3",15616,"F4",15872,"F5",16128,"F6",16384,"F7",16640,"F8",16896
  100. DATA "F9",17152,"F10",17408,"F11",34048,"F12",34304,"PrntScrn",100316,"ScrlLock",100302,"Pause",100019
  101. DATA "`",96,"1",49,"2",50,"3",51,"4",52,"5",53,"6",54,"7",55,"8",56,"9",57,"0",48,"-",45,"=",61,"BackSpce",8
  102. DATA "Insert",20992,"Home",18176,"PgUp",18688,"NumLock",100300,"/",47,"*",42,"~",126,"!",33,"@",64,"#",35
  103. DATA "$",36,"%",37,"^",94,"&",38,"*",42,"(",40,")",41,"_",95,"+",43,"TAB",9,"Q",81,"W",87,"E",69,"R",82
  104. DATA "T",84,"Y",89,"U",85,"I",73,"O",79,"P",80,"[",91,"]",93,"\",92,"A",65,"S",83,"D",68,"F",70,"G",71
  105. DATA "H",72,"J",74,"K",75,"L",76,";",59,"'",39,"Enter",13,"L-Shift",100304,"Z",90,"X",88,"C",67,"V",86
  106. DATA "B",66,"N",78,"M",77,",",44,".",46,"R-Shift",100303,"L-Ctrl",100306,"L-Win",100311,"L-Alt",100308
  107. DATA "SpaceBar",32,"R-Alt",100307,"R-Win",100312,"Menu",100319,"R-Ctrl",100305,"q",113,"w",119,"e",101,"r",114
  108. DATA "t",116,"y",121,"u",117,"i",105,"o",111,"p",112,"{",123,"}",125,"|",124,"Del",21248,"End",20224,"PgDn",20736
  109. DATA "a",97,"s",115,"d",100,"f",102,"g",103,"h",104,"j",106,"k",107,"l",108,":",58,"z",122,"x",120,"c",99
  110. DATA "v",118,"b",98,"n",110,"m",109,"<",60,">",62,"?",63,"UP-Arrow",18432,"Lt-Arrow",19200,"Dn-Arrow",20480,"Rt-Arrow",19712
  111.  
  112. MonsterData:
  113. '     NAME      hp  Mhp att def xp  mes #  Run Trp kd dp od tk ct rp pr ms sp
  114. DATA "        ",0,1,2,3,4,5,6,7,8,9,0,1,2,3,4,5,6,7
  115. DATA "SWORM   ",8,8,13,9,3,2,8,255,12,1,0,0,0,0,-1,-1,-1,0
  116. DATA "GR.SLIME",18,18,18,13,8,4,6,204,12,1,0,0,0,0,-1,-1,0,0
  117. DATA "WING EYE",11,11,12,10,6,2,6,127,15,1,0,0,0,0,-1,-1,-1,0
  118. DATA "MANEATER",16,16,12,10,13,3,5,255,15,1,0,0,0,0,-1,-1,0,0
  119. DATA "SCORPION",12,12,14,12,13,4,4,204,15,2,0,0,0,0,-1,-1,-1,0
  120. DATA "G.SCORPI",20,20,20,17,11,5,4,127,15,1,0,0,0,0,-1,-1,-1,0
  121. DATA "BL.SLIME",40,40,26,20,19,5,6,153,15,1,0,0,0,0,-1,-1,0,2
  122. DATA "N.FARMER",38,38,37,37,8,5,5,178,0,0,36,1,-1,-1,-1,-1,0,0
  123. DATA "OWL BEAR",18,18,22,18,12,5,4,153,12,1,0,0,0,0,-1,-1,-1,0
  124. DATA "DEADTREE",23,23,23,25,21,4,3,204,40,1,0,0,0,0,-1,-1,0,0
  125. DATA "SCORPIUS",22,22,25,20,27,8,5,102,15,1,0,0,0,0,-1,-1,-1,1
  126. DATA "E.FARMER",42,42,27,40,30,9,5,204,15,1,0,0,-1,-1,-1,-1,0,0
  127. DATA "GIANTFLY",25,25,30,21,32,7,4,102,15,1,0,0,0,0,-1,-1,-1,4
  128. DATA "CRAWLER ",40,40,31,32,30,9,3,127,15,1,0,0,0,0,-1,-1,0,0
  129. DATA "BARBRIAN",54,54,35,50,89,10,8,76,20,1,36,1,-1,-1,-1,-1,0,0
  130. DATA "GOLDLENS",28,28,36,35,24,9,4,127,15,1,0,0,0,0,-1,-1,-1,0
  131. DATA "RD.SLIME",29,29,37,25,31,11,3,153,15,1,0,0,0,0,-1,-1,0,1
  132. DATA "WERE BAT",50,50,37,35,63,11,4,127,15,1,0,0,0,0,-1,-1,-1,3
  133. DATA "BIG CLUB",46,46,40,36,40,9,2,204,15,1,0,0,0,0,-1,-1,0,0
  134. DATA "FISHMAN ",42,42,42,40,42,11,5,153,15,1,0,0,0,0,-1,-1,0,0
  135. DATA "EVILDEAD",30,30,43,36,8,14,3,229,12,1,0,0,0,0,-1,-1,0,0
  136. DATA "TARANTUL",50,50,50,43,51,10,2,153,38,1,0,0,0,-1,-1,-1,0,1
  137. DATA "MANTICOR",60,60,53,44,49,15,3,153,15,1,0,0,0,-1,0,-1,-1,4
  138. DATA "SKELETON",53,53,58,41,25,13,5,204,15,1,0,0,0,0,-1,-1,0,0
  139. DATA "ANT LION",66,66,59,52,7,8,1,178,12,1,0,0,0,0,-1,-1,0,1
  140. DATA "MARMAN  ",58,58,67,50,43,14,6,127,15,1,0,0,0,0,-1,-1,0,0
  141. DATA "DEZORIAN",76,76,77,63,105,18,5,127,12,1,0,0,-1,-1,-1,-1,0,0
  142. DATA "LEECH   ",70,70,67,47,47,15,4,165,12,1,0,0,0,0,-1,-1,0,3
  143. DATA "VAMPIRE ",67,67,68,46,71,15,2,204,12,1,39,1,0,0,-1,-1,-1,0
  144. DATA "ELEPHANT",86,86,62,48,38,17,5,204,12,1,0,0,0,0,-1,0,0,0
  145. DATA "GHOUL   ",68,68,64,47,26,16,3,178,12,1,0,0,0,0,-1,-1,0,0
  146. DATA "SHELFISH",62,62,77,52,46,16,3,229,20,1,0,0,0,0,-1,-1,0,0
  147. DATA "EXECUTER",62,62,73,50,63,12,3,102,53,1,0,0,0,0,-1,-1,0,0
  148. DATA "WIGHT   ",50,50,64,48,40,18,3,178,12,1,0,0,0,0,-1,-1,0,1
  149. DATA "SKULL-EN",57,57,75,53,37,18,3,178,12,1,0,0,0,0,-1,-1,0,0
  150. DATA "AMMONITE",90,90,88,60,71,19,2,153,63,1,0,0,0,0,-1,-1,0,0
  151. DATA "SPHINX  ",78,78,80,65,58,21,4,204,12,1,39,1,0,-1,0,-1,-1,0
  152. DATA "SERPENT ",80,80,100,66,96,23,1,178,15,1,0,0,0,0,-1,-1,-1,0
  153. DATA "SANDWORM",82,82,107,63,129,20,3,153,15,1,0,0,0,0,-1,-1,0,0
  154. DATA "LICH    ",60,60,84,62,33,22,2,204,12,1,0,0,0,0,-1,-1,0,1
  155. DATA "OCTOPUS ",90,90,85,68,64,20,1,191,12,1,0,0,0,0,-1,-1,0,0
  156. DATA "STALKER ",79,79,90,75,87,22,4,229,15,1,0,0,0,0,-1,-1,0,0
  157. DATA "EVILHEAD",86,86,118,77,136,20,3,127,15,1,0,0,-1,-1,-1,-1,0,0
  158. DATA "ZOMBIE  ",87,87,108,58,27,20,4,153,15,1,0,0,0,0,-1,-1,0,0
  159. DATA "BATALION",100,100,112,64,59,21,3,204,12,1,0,0,0,0,-1,-1,0,0
  160. DATA "ROBOTCOP",110,110,135,90,156,25,1,102,15,1,0,0,0,0,0,0,0,0
  161. DATA "SORCERER",110,110,121,74,120,26,2,204,51,1,0,0,0,0,-1,-1,0,4
  162. DATA "NESSIE  ",93,93,126,77,101,28,2,204,12,1,0,0,0,0,-1,-1,-1,0
  163. DATA "TARZIMAL",125,125,120,100,0,0,1,0,12,1,0,0,0,0,0,-1,0,4
  164. DATA "GOLEM   ",140,140,121,96,150,24,2,178,12,1,0,0,0,0,-1,0,0,0
  165. DATA "ANDROCOP",120,120,145,89,123,29,2,127,12,1,0,0,0,0,0,0,0,0
  166. DATA "TENTACLE",118,118,118,87,98,27,1,178,12,1,0,0,0,0,-1,-1,0,0
  167. DATA "GIANT   ",120,120,122,88,119,30,2,127,12,1,0,0,0,0,-1,0,0,0
  168. DATA "WYVERN  ",110,110,123,84,125,26,1,127,12,1,0,0,0,0,-1,-1,-1,0
  169. DATA "REAPER  ",185,185,135,102,254,30,1,204,51,1,0,0,0,0,-1,0,0,3
  170. DATA "MAGICIAN",138,138,145,90,187,32,1,127,12,1,0,0,0,0,-1,-1,0,5
  171. DATA "HORSEMAN",130,130,126,89,148,30,2,89,0,0,39,1,0,-1,0,0,0,4
  172. DATA "FROSTMAN",140,140,138,98,128,36,1,191,20,1,0,0,0,0,0,-1,0,0
  173. DATA "AMUNDSEN",133,133,140,98,120,32,1,178,12,1,0,0,0,0,0,-1,0,0
  174. DATA "RD.DRAGN",175,175,160,105,193,65,1,127,15,1,0,0,0,-1,0,-1,-1,0
  175. DATA "GR.DRAGN",160,160,145,95,176,53,1,153,12,1,0,0,0,-1,0,-1,-1,0
  176. DATA "SHADOW  ",165,165,172,104,0,60,1,127,12,1,0,0,0,0,-1,-1,0,0
  177. DATA "MAMMOTH ",180,180,154,100,125,40,5,178,15,1,0,0,0,0,-1,0,0,0
  178. DATA "CENTAUR ",190,190,155,100,133,31,1,127,40,1,0,0,0,-1,0,0,0,1
  179. DATA "MARAUDER",135,135,134,88,173,30,1,178,15,1,0,0,0,0,-1,0,0,5
  180. DATA "TITAN   ",190,190,146,97,138,32,2,127,33,1,0,0,0,0,-1,0,0,0
  181. DATA "MEDUSA  ",200,200,166,103,194,50,1,153,0,0,39,1,0,0,-1,0,0,6
  182. DATA "WT.DRAGN",200,200,180,104,234,75,1,153,15,1,0,0,0,-1,0,0,-1,0
  183. DATA "BL.DRAGN",210,210,155,90,178,88,1,153,12,1,0,0,0,-1,0,0,-1,0
  184. DATA "GD.DRAGN",170,170,200,98,0,100,1,0,0,0,0,0,0,0,0,0,-1,2
  185. DATA "DR.MAD  ",233,233,180,85,140,25,1,102,0,0,0,0,0,0,-1,-1,0,0
  186. DATA "LASSIC  ",238,238,230,180,0,0,1,0,0,0,0,0,0,0,0,0,0,7
  187. DATA "DARKFALZ",255,255,255,150,0,0,2,30,0,0,0,0,0,0,0,0,0,0
  188. DATA "SACCUBUS",255,255,150,250,0,10,1,0,0,0,0,0,0,0,0,0,0,1
  189.  
  190. PlayerLevelData:
  191. DATA 16,8,8,0,0,0,0
  192. DATA 20,10,11,0,0,0,20
  193. DATA 25,12,15,0,0,0,50
  194. DATA 34,14,20,4,1,1,100
  195. DATA 45,15,24,6,2,1,230
  196. DATA 54,18,27,8,3,1,330
  197. DATA 66,21,30,10,3,1,450
  198. DATA 76,23,33,12,3,1,600
  199. DATA 81,24,40,13,3,1,800
  200. DATA 93,25,51,14,3,1,1050
  201. DATA 99,27,60,15,3,1,1300
  202. DATA 111,30,64,16,4,1,1700
  203. DATA 123,31,68,18,4,1,2200
  204. DATA 132,34,75,20,5,1,2800
  205. DATA 140,36,80,22,5,1,3500
  206. DATA 153,38,85,22,5,2,4100
  207. DATA 159,40,90,24,5,2,5000
  208. DATA 166,41,96,24,5,2,6000
  209. DATA 173,43,100,25,5,2,7200
  210. DATA 182,44,107,25,5,2,8500
  211. DATA 187,46,110,26,5,2,10000
  212. DATA 192,48,112,26,5,2,12000
  213. DATA 200,49,113,27,5,2,14500
  214. DATA 204,50,114,28,5,2,17500
  215. DATA 208,51,115,29,5,2,23000
  216. DATA 210,52,119,29,5,2,30000
  217. DATA 212,53,117,30,5,2,38000
  218. DATA 214,54,118,30,5,2,45000
  219. DATA 216,55,119,32,5,2,52000
  220. DATA 218,56,120,32,5,2,63000
  221.  
  222. DATA 22,18,22,0,0,0,0
  223. DATA 30,21,26,0,0,0,50
  224. DATA 38,25,31,0,0,0,120
  225. DATA 42,28,34,0,0,0,220
  226. DATA 44,31,38,0,0,0,350
  227. DATA 54,35,41,12,1,1,680
  228. DATA 60,39,45,15,1,1,950
  229. DATA 64,42,53,17,1,1,1150
  230. DATA 70,45,55,19,2,1,1400
  231. DATA 78,48,60,21,2,1,1700
  232. DATA 84,50,63,22,2,1,2100
  233. DATA 90,51,68,23,3,1,2600
  234. DATA 116,52,71,25,3,1,3200
  235. DATA 118,56,74,27,3,1,3900
  236. DATA 121,59,80,30,3,2,4500
  237. DATA 132,61,85,34,3,2,5200
  238. DATA 142,63,89,36,3,3,6100
  239. DATA 150,67,95,38,3,3,7000
  240. DATA 155,70,100,40,3,3,8200
  241. DATA 162,73,102,44,4,3,9500
  242. DATA 175,76,104,46,4,3,10500
  243. DATA 183,77,106,47,4,3,13000
  244. DATA 193,79,108,48,4,3,15000
  245. DATA 202,80,112,49,4,3,18000
  246. DATA 208,81,113,50,4,3,22000
  247. DATA 210,82,114,51,4,3,30000
  248. DATA 211,83,115,52,4,3,36000
  249. DATA 212,84,116,53,4,3,42000
  250. DATA 213,85,117,54,4,3,50000
  251. DATA 214,86,118,55,4,3,60000
  252. DATA 42,13,13,0,0,0,0
  253. DATA 47,15,15,0,0,0,80
  254. DATA 52,17,17,0,0,0,160
  255. DATA 57,18,19,0,0,0,250
  256. DATA 60,19,21,0,0,0,350
  257. DATA 63,20,23,0,0,0,480
  258. DATA 67,21,25,0,0,0,630
  259. DATA 75,23,27,0,0,0,850
  260. DATA 82,24,29,0,0,0,1100
  261. DATA 94,25,31,0,0,0,1400
  262. DATA 100,26,34,0,0,0,1800
  263. DATA 107,27,37,0,0,0,2300
  264. DATA 116,28,40,0,0,0,3000
  265. DATA 129,30,43,0,0,0,3800
  266. DATA 131,31,45,0,0,0,4100
  267. DATA 135,32,47,0,0,0,5000
  268. DATA 140,33,49,0,0,0,6000
  269. DATA 147,35,53,0,0,0,7400
  270. DATA 150,36,56,0,0,0,9000
  271. DATA 156,37,61,0,0,0,10500
  272. DATA 162,38,65,0,0,0,12000
  273. DATA 169,39,66,0,0,0,13500
  274. DATA 175,40,67,0,0,0,15500
  275. DATA 179,41,68,0,0,0,17500
  276. DATA 187,42,69,0,0,0,20000
  277. DATA 188,43,70,0,0,0,28000
  278. DATA 189,44,71,0,0,0,35000
  279. DATA 190,45,72,0,0,0,41000
  280. DATA 191,46,73,0,0,0,50000
  281. DATA 192,47,74,0,0,0,60000
  282. DATA 45,18,30,12,1,1,0
  283. DATA 49,22,36,18,1,1,70
  284. DATA 54,23,41,22,1,1,150
  285. DATA 57,26,47,25,1,1,250
  286. DATA 61,29,53,28,1,1,380
  287. DATA 65,30,60,32,1,2,520
  288. DATA 71,32,65,36,1,2,700
  289. DATA 79,34,71,36,2,3,800
  290. DATA 83,36,75,41,2,3,900
  291. DATA 89,38,82,43,2,3,1100
  292. DATA 95,40,85,46,2,3,1400
  293. DATA 101,41,88,48,3,3,1900
  294. DATA 107,43,92,49,3,3,2500
  295. DATA 112,45,96,50,4,3,3300
  296. DATA 118,47,99,52,4,3,4200
  297. DATA 124,48,100,54,4,3,5300
  298. DATA 131,50,103,58,4,4,6500
  299. DATA 137,53,106,62,5,4,8800
  300. DATA 143,57,108,66,5,4,10000
  301. DATA 155,60,110,70,5,5,12000
  302. DATA 161,62,112,72,5,5,14000
  303. DATA 168,64,115,75,5,5,15800
  304. DATA 172,66,116,76,5,5,18000
  305. DATA 186,68,117,77,5,5,19500
  306. DATA 190,70,118,78,5,5,21000
  307. DATA 191,71,119,79,5,5,25000
  308. DATA 192,72,120,80,5,5,30000
  309. DATA 193,73,121,81,5,5,38000
  310. DATA 194,74,122,82,5,5,45000
  311. DATA 195,75,123,83,5,5,50000
  312.  
  313. ItemData:
  314. '    NAME       PWR COST  Al  MY  OD  NO  SEL DRP TYP
  315. DATA "        ",0,0,-1,-1,-1,-1,0,0,0
  316. DATA "WOODCANE",3,25,-1,0,-1,-1,-1,-1,1
  317. DATA "SHT. SWD",4,40,-1,0,-1,-1,-1,-1,1
  318. DATA "IRN. SWD",12,75,-1,0,-1,0,-1,-1,1
  319. DATA "WAND    ",10,1200,0,0,0,-1,-1,-1,1
  320. DATA "IRN.FANG",10,700,0,-1,0,0,-1,-1,1
  321. DATA "IRN. AXE",10,64,0,0,-1,0,-1,-1,1
  322. DATA "TIT. SWD",21,320,-1,0,-1,0,-1,-1,1
  323. DATA "CRC. SWD",31,1120,-1,0,-1,0,-1,-1,1
  324. DATA "NEEDLGUN",18,400,0,0,-1,0,-1,-1,1
  325. DATA "SIL.FANG",30,1620,0,-1,0,0,-1,-1,1
  326. DATA "HEAT.GUN",30,1540,0,0,-1,0,-1,-1,1
  327. DATA "LGT.SABR",46,2980,-1,0,-1,0,-1,-1,1
  328. DATA "LASR.GUN",50,4120,0,0,-1,0,-1,-1,1
  329. DATA "LAC. SWD",60,0,-1,0,-1,0,0,-1,1
  330. DATA "LAC. AXE",80,0,0,0,-1,0,0,-1,1
  331. DATA "LTH.ARMR",5,28,-1,0,-1,0,-1,-1,2
  332. DATA "WHT.MANT",5,78,0,0,0,-1,-1,-1,2
  333. DATA "LGT.SUIT",15,290,-1,0,-1,0,-1,-1,2
  334. DATA "IRN.ARMR",20,84,0,0,-1,0,-1,-1,2
  335. DATA "THCK.FUR",30,630,0,0,-1,0,-1,-1,2
  336. DATA "ZIR.ARMR",30,1000,-1,0,-1,0,-1,-1,2
  337. DATA "DMD.ARMR",60,15000,-1,0,-1,0,-1,-1,2
  338. DATA "LAC.ARMR",80,0,0,0,-1,0,0,-1,2
  339. DATA "FRD.MANT",40,0,0,0,0,-1,0,-1,2
  340. DATA "LTH. SLD",3,30,-1,0,-1,0,-1,-1,3
  341. DATA "BRNZ.SLD",8,310,0,0,-1,0,-1,-1,3
  342. DATA "IRN. SLD",15,520,-1,0,-1,0,-1,-1,3
  343. DATA "CRC. SLD",23,1400,-1,0,-1,0,-1,-1,3
  344. DATA "GLOVE   ",40,3300,0,-1,0,0,-1,-1,3
  345. DATA "LASR.SLD",30,4800,-1,0,-1,-1,-1,-1,3
  346. DATA "MIRR.SLD",40,0,0,0,-1,0,-1,-1,3
  347. DATA "LAC. SLD",50,0,-1,0,-1,0,0,-1,3
  348. DATA "LANDROVR",0,5200,-1,-1,-1,-1,0,0,4
  349. DATA "HOVRCRFT",0,0,-1,-1,-1,-1,0,0,4
  350. DATA "ICE DIGR",0,12000,-1,-1,-1,-1,0,0,4
  351. DATA "COLA    ",10,10,-1,-1,-1,-1,-1,-1,5
  352. DATA "BURGER  ",40,40,-1,-1,-1,-1,-1,-1,5
  353. DATA "FLUTE   ",0,320,-1,-1,-1,-1,-1,-1,0
  354. DATA "FLASH   ",0,20,-1,-1,-1,-1,-1,-1,0
  355. DATA "ESCAPER ",0,10,-1,-1,-1,-1,-1,-1,0
  356. DATA "TRANSER ",0,48,-1,-1,-1,-1,-1,-1,0
  357. DATA "MAGC HAT",0,20,-1,-1,-1,-1,-1,-1,0
  358. DATA "ALSULIN ",0,0,-1,-1,-1,-1,0,0,4
  359. DATA "POLYMTRL",0,0,-1,-1,-1,-1,-1,-1,4
  360. DATA "DUGN KEY",0,0,-1,-1,-1,-1,0,-1,0
  361. DATA "SPHERE  ",0,30,-1,-1,-1,-1,-1,-1,0
  362. DATA "TORCH   ",0,0,-1,-1,-1,-1,0,0,0
  363. DATA "PRISM   ",0,0,-1,-1,-1,-1,0,0,0
  364. DATA "NUTS    ",0,0,-1,-1,-1,-1,0,0,0
  365. DATA "HAPSBY  ",0,0,-1,-1,-1,-1,0,0,0
  366. DATA "ROADPASS",0,200,-1,-1,-1,-1,0,0,0
  367. DATA "PASSPORT",0,100,-1,-1,-1,-1,-1,-1,0
  368. DATA "COMPASS ",0,0,-1,-1,-1,-1,0,0,4
  369. DATA "CAKE    ",0,1000,-1,-1,-1,-1,-1,-1,4
  370. DATA "LETTER  ",0,0,-1,-1,-1,-1,0,0,4
  371. DATA "LAC. POT",0,0,-1,-1,-1,-1,0,0,4
  372. DATA "MAG.LAMP",0,1400,-1,-1,-1,-1,-1,-1,0
  373. DATA "AMBR EYE",0,0,-1,-1,-1,-1,0,0,0
  374. DATA "GAS. SLD",0,1000,-1,-1,-1,-1,-1,0,4
  375. DATA "CRYSTAL ",0,0,-1,-1,-1,-1,0,-1,0
  376. DATA "M SYSTEM",0,0,-1,-1,-1,-1,0,0,0
  377. DATA "MRCL KEY",0,0,-1,-1,-1,-1,0,-1,0
  378. DATA "ZILLION ",0,0,-1,-1,-1,-1,0,0,0
  379. DATA "SECRETS ",0,200,-1,-1,-1,-1,0,0,0
  380.  
  381. SpellData:
  382. DATA "    ",0
  383. DATA "BYE",2
  384. DATA "CHAT",2
  385. DATA "CURE",6
  386. DATA "EXIT",4
  387. DATA "FIRE",4
  388. DATA "FLY",8
  389. DATA "HEAL",2
  390. DATA "HELP",10
  391. DATA "OPEN",4
  392. DATA "PROT",10
  393. DATA "RISE",12
  394. DATA "ROPE",4
  395. DATA "TELE",4
  396. DATA "TERR",4
  397. DATA "THUN",16: '25 - 40pts damage to all enemies
  398. DATA "TRAP",3
  399. DATA "WALL",10
  400. DATA "WIND",12
  401.  
  402.  
  403. AlisNonCombat:
  404. DATA 7,6,0,0,0
  405. AlisCombat:
  406. DATA 7,1,2,5,12
  407. MyauNonCombat:
  408. DATA 3,16,4,0,0
  409. MyauCombat:
  410. DATA 3,14,17,8,0
  411. OdinNonCombat:
  412. DATA 0,0,0,0,0
  413. OdinCombat:
  414. DATA 0,0,0,0,0
  415. NoahNonCombat:
  416. DATA 3,4,9,11,0
  417. NoahCombat:
  418. DATA 5,13,18,10,15
  419.  
  420. '-----------------End of Data area-----------------
  421. '-----------------Load from file area--------------
  422. OPEN "dialog_fixed.txt" FOR BINARY AS #1
  423.  LINE INPUT #1, Line$(i%)
  424.  Line$(i%) = RTRIM$(LTRIM$(Line$(i%)))
  425.  i% = i% + 1
  426. Linecount% = i% - 1
  427. PRINT Linecount%
  428. '-----------------Load data into arrays------------
  429. RESTORE KeyCodesData
  430. FOR i~%% = 0 TO 133
  431.  READ KeyCodes(i~%%).Nam, KeyCodes(i~%%).Value
  432. NEXT i~%%
  433.  
  434. RESTORE MonsterData
  435. FOR i%% = 0 TO 74
  436.  READ M(i%%).Nam, M(i%%).Hp, M(i%%).MHp, M(i%%).Atp, M(i%%).Dfp, M(i%%).Exp, M(i%%).Mes, M(i%%).Num, M(i%%).Flee
  437.  READ M(i%%).Trap, M(i%%).Kind, M(i%%).Drop, M(i%%).Odds, M(i%%).Talk, M(i%%).Chat, M(i%%).Rope, M(i%%).Prot, M(i%%).Myst
  438.  READ M(i%%).Special
  439. NEXT i%%
  440.  
  441. RESTORE PlayerLevelData
  442. FOR j%% = 0 TO 3
  443.  FOR i%% = 1 TO 30
  444.   READ Pl(j%%, i%%).HitPts, Pl(j%%, i%%).AttVal, Pl(j%%, i%%).DefVal, Pl(j%%, i%%).MagPts, Pl(j%%, i%%).Combat, Pl(j%%, i%%).NonCbt, Pl(j%%, i%%).ExpPts
  445.  NEXT i%%
  446. NEXT j%%
  447.  
  448. RESTORE ItemData
  449. FOR i%% = 0 TO 64
  450.  READ I(i%%).Nam, I(i%%).Pwr, I(i%%).Cost, I(i%%).Alis, I(i%%).Myau, I(i%%).Odin, I(i%%).Noah, I(i%%).CanSell, I(i%%).CanDrop, I(i%%).Is_Type
  451. NEXT i%%
  452.  
  453. RESTORE SpellData
  454. FOR i%% = 0 TO 18
  455.  READ S(i%%).Nam, S(i%%).Cost
  456. NEXT i%%
  457.  
  458. RESTORE AlisNonCombat
  459. FOR i%% = 0 TO 4
  460.  READ PSL(0, 0, i%%).link
  461. NEXT i%%
  462. RESTORE AlisCombat
  463. FOR i%% = 0 TO 4
  464.  READ PSL(0, 1, i%%).link
  465. NEXT i%%
  466. RESTORE MyauNonCombat
  467. FOR i%% = 0 TO 4
  468.  READ PSL(1, 0, i%%).link
  469. NEXT i%%
  470. RESTORE MyauCombat
  471. FOR i%% = 0 TO 4
  472.  READ PSL(1, 1, i%%).link
  473. NEXT i%%
  474. RESTORE OdinNonCombat
  475. FOR i%% = 0 TO 4
  476.  READ PSL(2, 0, i%%).link
  477. NEXT i%%
  478. RESTORE OdinCombat
  479. FOR i%% = 0 TO 4
  480.  READ PSL(2, 1, i%%).link
  481. NEXT i%%
  482. RESTORE NoahNonCombat
  483. FOR i%% = 0 TO 4
  484.  READ PSL(3, 0, i%%).link
  485. NEXT i%%
  486. RESTORE NoahCombat
  487. FOR i%% = 0 TO 4
  488.  READ PSL(3, 1, i%%).link
  489. NEXT i%%
  490. D(0) = "NORTH"
  491. D(1) = "EAST "
  492. D(2) = "WEST "
  493. D(3) = "SOUTH"
  494.  
  495. OPEN "TempData.Dat" FOR BINARY AS #1
  496. PUT #1, , M()
  497. PUT #1, , I()
  498. PUT #1, , S()
  499. PUT #1, , Pl()
  500. PUT #1, , PSL()
  501. PUT #1, , KeyCodes()
  502. PUT #1, , Linecount%
  503. FOR i% = 0 TO Linecount%
  504.  L%% = LEN(Line$(i%))
  505.  PUT #1, , L%% 'length of line
  506.  PUT #1, , Line$(i%) 'line of dialog
  507. NEXT i%
  508. PUT #1, , D()
Granted after becoming radioactive I only have a half-life!

Offline TempodiBasic

  • Forum Resident
  • Posts: 1792
    • View Profile
Re: Help with a Compliation error
« Reply #1 on: June 07, 2021, 07:43:25 pm »
Hi Cobalt
I can confirm to have the same experience.
Ok  but say me: for what reason do you use LOC(1) twice in this your code?
Programming isn't difficult, only it's  consuming time and coffee

Offline Cobalt

  • QB64 Developer
  • Forum Resident
  • Posts: 878
  • At 60 I become highly radioactive!
    • View Profile
Re: Help with a Compliation error
« Reply #2 on: June 07, 2021, 09:33:14 pm »
Hi Cobalt
I can confirm to have the same experience.
Ok  but say me: for what reason do you use LOC(1) twice in this your code?

@SpriggsySpriggs let me know (over on Discord) that this issue has come up before so I don't think anybody is doing anything about it at the moment. I don't want to side track from Phantasy Star right now so I'm not going to. And by the time I am done I will probably forget about the issue.

As for the LOC(1), I was having some errors reading the data back so I was just checking where certain data was starting in the output.

I just left those there in case I had problems in the future. Once every thing is working I will probably remove them or at least REM them out.
Granted after becoming radioactive I only have a half-life!

Offline NOVARSEG

  • Forum Resident
  • Posts: 509
    • View Profile
Re: Help with a Compliation error
« Reply #3 on: June 08, 2021, 12:41:42 am »
@ Cobalt

Got the same error with DIM D(3) AS STRING * 5

but no error with   DIM D(3) AS INTEGER

 bug in QB64?

Code: QB64: [Select]
  1. OPEN "test.txt" FOR BINARY AS #1
  2.  
  3.  
  4. D(0) = 0
  5. D(1) = 1
  6. D(2) = 2
  7. D(3) = 3
  8.  
  9. PUT #1, , D()
  10.  
  11. SEEK #1, 1
  12.  
  13. GET #1, , E()
  14.  
  15. PRINT E(0)
  16. PRINT E(1)
  17. PRINT E(2)
  18. PRINT E(3)
  19.  






Offline SMcNeill

  • QB64 Developer
  • Forum Resident
  • Posts: 3972
    • View Profile
    • Steve’s QB64 Archive Forum
Re: Help with a Compliation error
« Reply #4 on: June 08, 2021, 02:05:29 am »
I posted on this before.  It’s a bug in QB64.  You can’t use PUT/GET with whole string arrays, unless you want to manually go in and edit your translated code yourself.

Simple workaround:

DIM a(3) AS STRING

FOR i = 0 TO 3
    PUT #1, , a(i)
NEXT

https://github.com/SteveMcNeill/Steve64 — A github collection of all things Steve!

Offline TempodiBasic

  • Forum Resident
  • Posts: 1792
    • View Profile
Re: Help with a Compliation error
« Reply #5 on: June 08, 2021, 04:27:55 am »
@Cobalt
Quote
As for the LOC(1), I was having some errors reading the data back so I was just checking where certain data was starting in the output.
very interesting backtrack tecnique!
Thanks to share
Programming isn't difficult, only it's  consuming time and coffee

Offline bplus

  • Global Moderator
  • Forum Resident
  • Posts: 8053
  • b = b + ...
    • View Profile
Re: Help with a Compliation error
« Reply #6 on: June 08, 2021, 05:08:40 am »
Another work around
Code: QB64: [Select]
  1. s$ = "NORTHEAST WEST SOUTH"
  2. someplace = 100
  3.  
  4. ' the store
  5. Open "TempData.Dat" For Binary As #1
  6. Put #1, someplace, s$
  7.  
  8. Dim r As String * 20
  9. ' the retrieve
  10. Open "TempData.Dat" For Binary As #1
  11. Get #1, someplace, r
  12.  
  13. ' the unpack
  14. Dim D(3) As String * 5
  15. For i = 0 To 3
  16.     D(i) = Mid$(r, i * 5 + 1, 5)
  17.     Print D(i)
  18.  

Maybe more work?
« Last Edit: June 08, 2021, 05:15:14 am by bplus »