Author Topic: Problem whith install in windows 10 Home  (Read 7359 times)

0 Members and 1 Guest are viewing this topic.

Offline Juanjogomez

  • Forum Regular
  • Posts: 117
    • View Profile
Problem whith install in windows 10 Home
« on: April 27, 2020, 02:44:32 am »
This is one of the posts that were lost on the afternoon of the 26th due to the server failure.

In it, I asked for help because the programs that I have made -and sold- to a client do not work on their computer. They simply go out when you finch on them (they don't even open).

After several posts and suggestions from other forum members, in which you told me to remove antivirus, Wwindows Defender and put it on the firewall whitelist, and given the problem that it remains exactly the same, my last question was that if not It would be because of the graphics card, although the program does not use graphics, only text, as it is a billing program.
The graphics card has a maximum resolution of 1440x900 and the processor is a 1900 Intel Celeron

Offline Pete

  • Forum Resident
  • Posts: 2361
  • Cuz I sez so, varmint!
    • View Profile
Re: Problem whith install in windows 10 Home
« Reply #1 on: April 27, 2020, 03:42:31 am »
I'm guessing if you sold it, it is NOT source, just the exe. If so, what version of QB64 was it made in? I really can't recall if any version of SDL can't run in Win 10, 64-bit. I have the last SDL version made on my Win 10 Home 64-bit, and I can compile and run programs on it. As far as the anti-virus, if this is an exe program, it would have to be whitelisted by name and folder name. Again, I'm guessing your client doesn't have a QB64 folder, or the source code, just the exe file and whatever folder that was installed in. If it was installed in one of the Windows programs files, I'd try copying it to a non-windows folder, and see if it would at least open. Of course if it uses data files, and they are in the Windows Programs folder, that isn't going to solve for actually using the program, but it would give you an idea if Windows folder permissions are interfering with it or not. Also, if the client has a desktop icon to launch it or can access it through explorer, right click and select "Run as Administrator" and see if that solves the problem.

By the way, I've never had to whitelist a non-Windows folder QB64 exe program from windows Defender, but other anti-virus, like Norton, Avast, etc., require that you do whitelist QB64 exe files.

Pete
Want to learn how to write code on cave walls? https://www.tapatalk.com/groups/qbasic/qbasic-f1/

FellippeHeitor

  • Guest
Re: Problem whith install in windows 10 Home
« Reply #2 on: April 27, 2020, 06:22:43 am »
It could be a graphics card issue. Keep in mind that, unless you're outputting to $CONSOLE:ONLY, even a SCREEN 0 window is a graphic window with QB64, as we use OpenGL for rendering. - Sorry, Pete.

Offline EricE

  • Forum Regular
  • Posts: 114
    • View Profile
Re: Problem whith install in windows 10 Home
« Reply #3 on: April 27, 2020, 06:24:47 am »
Hello Juanjogomez,

What are the differences between your computer, the development computer, and the customer's computer?
In those differences might be the reason the program does not run, or even open, on the customer computer.

Offline Juanjogomez

  • Forum Regular
  • Posts: 117
    • View Profile
Re: Problem whith install in windows 10 Home
« Reply #4 on: April 27, 2020, 06:37:18 am »
Hi at all
The program is all done on screen 0, that is 25x80 characters.
I have a computer with windows 7 64 bits, another with windows 8 32 bits and two others with windows 10 Pro 64 bits.
The client has a computer with Windows XP (in which it works correctly), or a laptop with Windows 10 (I don't know if home, bussines ...) 64 bits in which it also works correctly, and another desktop computer with Windows 10 Home 64 bit, which is the one that doesn't work.

The program folder is not inside the windows folder and the data is in a MariaDb 10 database.

As Pete, I've never had to whitelist a non-Windows folder QB64 exe program from windows Defender, and I have Avast on all my computers without problem


Offline Juanjogomez

  • Forum Regular
  • Posts: 117
    • View Profile
Re: Problem whith install in windows 10 Home
« Reply #5 on: April 27, 2020, 06:41:22 am »
Regarding if it is a graphic card problem, what is the minimum card or what configuration should it have?

Juanjo Gómez

FellippeHeitor

  • Guest
Re: Problem whith install in windows 10 Home
« Reply #6 on: April 27, 2020, 08:37:30 am »
Nah, you said the IDE runs there, so it's not that.

Also, there have been some minor cases in which the proper drivers were not installed caused issues for some people, not a specific graphic card requirement issue.

Offline Pete

  • Forum Resident
  • Posts: 2361
  • Cuz I sez so, varmint!
    • View Profile
Re: Problem whith install in windows 10 Home
« Reply #7 on: April 27, 2020, 02:06:00 pm »
Since this is for business use. I'd recommend your client buy a new desktop computer. Ones to run business apps, not games, are dirt cheap these days. Over the years, I had 5 computers, all different with different OS's. to run my QB business programs. If I ever put those apps on a computer and they wouldn't run, I'd just get another computer, rather than fiddle with hardware issues. I did know a pretty good hardware guy, so I maybe i would have given him a shot at it, first. Your client might want to do the same. Just tell him, Dammit Jim, I'm a programmer, not a manufacture! If he's a Star Trek fan, he'll get that. If he's a Star Wars fan, he deserves not to have working programs, a house, a livelihood, oh, or a toothbrush.

Pete
Want to learn how to write code on cave walls? https://www.tapatalk.com/groups/qbasic/qbasic-f1/

Offline Juanjogomez

  • Forum Regular
  • Posts: 117
    • View Profile
Re: Problem whith install in windows 10 Home
« Reply #8 on: April 28, 2020, 02:28:28 am »
Thank you

I have told you to factory reset the computer, to see if there is any internal Windows deconfiguration.
I'll comment on what happened in the end.

Juanjo Gómez

Offline krovit

  • Forum Regular
  • Posts: 179
    • View Profile
Re: Problem whith install in windows 10 Home
« Reply #9 on: May 04, 2020, 05:56:56 pm »
hi!
maybe you should try to see if your app works on windows 10 pro. Maybe you developed and tested the code with windows 7 professional or windows 10 pro, and didn't try it on win10 home.

The home version (not to mention the N version with which you can't do anything but consult your mail and a little more) has a very bad tendency to consider only the official apps downloaded from recognized sites (those of windows!) and not those of third parties (for example your EXE).
Maybe there for them seems to have installed your EXE but then... do as he likes.

This is a known issue that had already been announced (and feared) with the advent of windows 10: on the lower versions of the pro some programs may not work or cannot be installed.

I don't know if this restriction is better or if something's wrong with your EXE.



Nothing is easy, especially when it appears simple (and nothing could be as dangerous as trying to do good to others)

Offline Juanjogomez

  • Forum Regular
  • Posts: 117
    • View Profile
Re: Problem whith install in windows 10 Home
« Reply #10 on: May 09, 2020, 11:29:43 am »
Hi!
Thanks for that information.
I am waiting for the client to install a higher version of Windows 10.

Offline Juanjogomez

  • Forum Regular
  • Posts: 117
    • View Profile
Re: Problem whith install in windows 10 Home
« Reply #11 on: June 08, 2020, 11:18:51 am »
I go back to the thread and I am desperate.
The client has installed a higher version of windows 10 and the program still does not work.
What's more, I have been testing and there are some of the programs that make it up (there are 32 programs in total) that do work and others do not on your computer).
I have installed the group of programs on my son's computer, which has the same operating system as mine ... windows 10 Pro, with a better graphics card and more memory than mine, and the same thing happens, some programs work and others not.
The worst thing is that I have installed on my son's computer QB64 1.3 32 bits, which is the one I work with, and I have loaded one of the programs that does not work, and when I hit F5, it tries to compile (the screen is set darker), but in the end it returns to the interpreter, so it does not work even from the interpreter.
I honestly don't know what to do and I get the feeling that I have thrown away more than 1 year of programming with a Qb64 incompatibility problem with some computers.
I hope someone can find a solution to my problem because right now I am blocked. I cannot market a program that works on some computers if and on others it does not.

I am attaching one of those that does not work. The Options MENU program

Code: QB64: [Select]
  1. ON ERROR GOTO 15000
  2. COMMON SHARED todobien
  3. 'IF todobien = 0 THEN PRINT "ACCESO DENEGADO": x$ = INPUT$(1): SYSTEM
  4.  
  5. OPEN "c:\ALMAv10\SERVIDOR.DAT" FOR INPUT AS 1
  6. LINE INPUT #1, a$
  7. servidor$ = _TRIM$(a$)
  8. LINE INPUT #1, a$
  9. usuario$ = _TRIM$(a$)
  10. LINE INPUT #1, a$
  11. clave$ = _TRIM$(a$)
  12. LINE INPUT #1, a$
  13. bdatos$ = _TRIM$(a$)
  14. LINE INPUT #1, a$
  15. puerto = VAL(a$)
  16.  
  17. 'servidor$ = "127.0.0.1"
  18. 'usuario$ = "root"
  19. 'clave$ = "1451"
  20. 'bdatos$ = "ALMA20"
  21. 'puerto = 0
  22.  
  23. conn = mysql_init(0)
  24. REDIM SHARED DB_RESULT(columns, rows) AS STRING
  25. 'PRINT "MYSQL Client: " + mysql_get_client_info$
  26.  
  27. IF conn = 0 THEN
  28.     PRINT "No puedo iniciar MYSQL client!": SLEEP (0): x$ = INKEY$
  29.  
  30. DIM conexion AS _OFFSET
  31. '*** Abrir Base de Datos ***
  32. conexion = mysql_real_connect(conn, servidor$, usuario$, clave$, bdatos$, puerto, 0, 0)
  33. IF conexion = 0 THEN PRINT "NO HE PODIDO CONECTAR CON EL SERVIDOR": x$ = INPUT$(1)
  34.  
  35. busclave$ = "SELECT * FROM const WHERE  id= '1'" + CHR$(0)
  36. CALL basedato(busclave$, rows, columns)
  37. fechoy$ = RIGHT$(DB_RESULT(4, 1), 2) + MID$(DB_RESULT(4, 1), 6, 2) + MID$(DB_RESULT(4, 1), 3, 2)
  38. empresa$ = SPACE$(5) + DB_RESULT(24, 1) + SPACE$(40 - LEN(DB_RESULT(24, 1))) + SPACE$(22)
  39. empresa$ = empresa$ + LEFT$(fechoy$, 2) + "/" + MID$(fechoy$, 3, 2) + "/" + RIGHT$(fechoy$, 2) + SPACE$(5)
  40. dd1$ = DB_RESULT(24, 1) + SPACE$(30 - LEN(DB_RESULT(24, 1)))
  41. dd2$ = DB_RESULT(25, 1) + SPACE$(30 - LEN(DB_RESULT(25, 1)))
  42. dd3$ = DB_RESULT(26, 1) + SPACE$(30 - LEN(DB_RESULT(26, 1)))
  43. opnoiva = VAL(DB_RESULT(54, 1))
  44. maxlaser = VAL(DB_RESULT(61, 1))
  45. op = VAL(DB_RESULT(56, 1))
  46.  
  47. ON TIMER(1) GOSUB 17000
  48.  
  49. 100 '---------------------------------------------------------------------------
  50. '------------------------------- MENU GENERAL ------------------------------
  51. '---------------------------------------------------------------------------
  52. COLOR 7, 0
  53. FOR n% = 1 TO 25
  54.     PRINT STRING$(80, 176);
  55. COLOR 7, 4
  56. LOCATE 2, 2: PRINT "  "; dd1$; "  "
  57. LOCATE 3, 2: PRINT "  "; dd2$; "  "
  58. LOCATE 4, 2: PRINT "  "; dd3$; "  "
  59. COLOR 7, 0
  60. LOCATE 3, 36: PRINT " ": LOCATE 4, 36: PRINT " ": LOCATE 5, 3: PRINT SPC(34);
  61. COLOR 7, 4
  62. LOCATE 2, 49: PRINT "  ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿  "
  63. LOCATE 3, 49: PRINT "  ³ ALMACEN S.Q.L   v.10.0 ³  "
  64. LOCATE 4, 49: PRINT "  ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ  "
  65. COLOR 7, 0
  66. LOCATE 3, 79: PRINT " ": LOCATE 4, 79: PRINT " ": LOCATE 5, 50: PRINT SPC(30);
  67. COLOR 0, 2
  68. LOCATE 18, 2: PRINT " ÚÄÄÄÄÄÄ¿ "
  69. LOCATE 19, 2: PRINT " ³  JJ  ³ "
  70. LOCATE 20, 2: PRINT " ³ Soft ³ "
  71. LOCATE 21, 2: PRINT " ÀÄÄÄÄÄÄÙ "
  72. COLOR 7, 0
  73. LOCATE 19, 12: PRINT " ": LOCATE 20, 12: PRINT " "
  74. LOCATE 21, 12: PRINT " ": LOCATE 22, 3: PRINT SPC(10);
  75. COLOR 1, 7
  76. LOCATE 7, 20: PRINT " ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ» "
  77. LOCATE 8, 20: PRINT " º ";
  78. COLOR 15, 1
  79. PRINT "             M E N U              ";
  80. COLOR 1, 7
  81. PRINT " º "
  82. LOCATE 9, 20: PRINT " ÇÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄĶ "
  83. LOCATE 10, 20: PRINT " º  1.- Ficheros Maestros.            º "
  84. LOCATE 11, 20: PRINT " º  2.- Entrada y Venta.              º "
  85. LOCATE 12, 20: PRINT " º  3.- Cuadre de Venta.              º "
  86. LOCATE 13, 20: PRINT " º  4.- Gesti¢n de Facturas.          º "
  87. LOCATE 14, 20: PRINT " º  5.- Gesti¢n de Impuestos.         º "
  88. LOCATE 15, 20: PRINT " º  6.- Arqueo y Final.               º "
  89. LOCATE 16, 20: PRINT " º  7.- Programas Auxiliares.         º "
  90. LOCATE 17, 20: PRINT " ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ "
  91. COLOR 7, 0
  92. FOR n% = 8 TO 17
  93.     LOCATE n%, 60: PRINT " "
  94. NEXT n%
  95. LOCATE 18, 21: PRINT SPC(40);
  96. COLOR 7, 1
  97. LOCATE 24, 1: PRINT "    Fecha                                                                Hora   ";
  98. LOCATE 25, 1: PRINT "    "; LEFT$(fechoy$, 2); "/"; MID$(fechoy$, 3, 2);
  99. PRINT "/"; RIGHT$(fechoy$, 2); SPACE$(68);
  100. PCOPY 0, 1
  101. IF op > 100 AND op < 200 THEN GOTO op1
  102. IF op > 200 AND op < 300 THEN GOTO op2
  103. IF op > 300 AND op < 400 THEN GOTO op3
  104. IF op > 400 AND op < 500 THEN GOTO op4
  105. IF op > 500 AND op < 600 THEN GOTO op5
  106. IF op > 600 AND op < 700 THEN GOTO op6
  107. IF op > 700 AND op < 800 THEN GOTO op7
  108. 500 x$ = INKEY$: IF x$ = "" THEN 500
  109. IF x$ = "1" THEN GOTO op1
  110. IF x$ = "2" THEN GOTO op2
  111. IF x$ = "3" THEN GOTO op3
  112. IF x$ = "4" THEN GOTO op4
  113. IF x$ = "5" THEN GOTO op5
  114. IF x$ = "6" THEN GOTO op6
  115. IF x$ = "7" THEN GOTO op7
  116. IF x$ = CHR$(27) THEN 2000
  117. GOTO 500
  118.  
  119. op1:
  120. '----------------------- VENTANA DE OPCION 1 ------------------------------
  121. COLOR 0, 2
  122. LOCATE 10, 30: PRINT " ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ» "
  123. LOCATE 11, 30: PRINT " º ";
  124. COLOR 15, 0
  125. PRINT "  1.- Ficheros Maestros.          ";
  126. COLOR 0, 2
  127. PRINT " º "
  128. LOCATE 12, 30: PRINT " ÇÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄĶ "
  129. LOCATE 13, 30: PRINT " º  1.- Fichero de Clientes.          º "
  130. LOCATE 14, 30: PRINT " º  2.- Fichero de Proveedores.       º "
  131. LOCATE 15, 30: PRINT " º  3.- Fichero de Art¡culos.         º "
  132. LOCATE 16, 30: PRINT " º  4.- Fichero de Datos Generales.   º "
  133. LOCATE 17, 30: PRINT " º  5.- Fichero de Tipos de IVA.      º "
  134. LOCATE 18, 30: PRINT " ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ "
  135. COLOR 7, 0
  136. FOR n% = 11 TO 18
  137.     LOCATE n%, 70: PRINT " "
  138. NEXT n%
  139. LOCATE 19, 31: PRINT SPC(40);
  140. 1080 x$ = INKEY$: IF x$ = "" THEN 1080
  141. IF ASC(x$) = 27 THEN PCOPY 1, 0: GOTO 500
  142. IF x$ = "1" THEN c$ = "110": b$ = "FICLI": GOTO 32000
  143. IF x$ = "2" THEN c$ = "120": b$ = "FIPRO": GOTO 32000
  144. IF x$ = "3" THEN c$ = "130": b$ = "FIART": GOTO 32000
  145. IF x$ = "4" THEN c$ = "140": b$ = "FIDAT": GOTO 32000
  146. IF x$ = "5" THEN c$ = "150": b$ = "FICHEIVA": GOTO 32000
  147. GOTO 1080
  148.  
  149. op2:
  150. '----------------------- VENTANA DE OPCION 2 ------------------------------
  151. COLOR 0, 2
  152. LOCATE 10, 30: PRINT " ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ» "
  153. LOCATE 11, 30: PRINT " º ";
  154. COLOR 15, 0
  155. PRINT "  2.- Entrada y Venta.            ";
  156. COLOR 0, 2
  157. PRINT " º "
  158. LOCATE 12, 30: PRINT " ÇÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄĶ "
  159. LOCATE 13, 30: PRINT " º  1.- Entrada de Art¡culos.         º "
  160. LOCATE 14, 30: PRINT " º  2.- Existencias/Precios.          º "
  161. LOCATE 15, 30: PRINT " º  3.- Listas de Precios(ABC).       º "
  162. LOCATE 16, 30: PRINT " º  4.- Listas de Precios(Individual).º "
  163. LOCATE 17, 30: PRINT " º  5.- Albaranes/Facturaci¢n.        º "
  164. LOCATE 18, 30: PRINT " º  6.- Listado de Albaranes.         º "
  165. LOCATE 19, 30: PRINT " º  7.- Lista de Kilos por periodo.   º "
  166. LOCATE 20, 30: PRINT " ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ "
  167. COLOR 7, 0
  168. FOR n% = 11 TO 20
  169.     LOCATE n%, 70: PRINT " "
  170. NEXT n%
  171. LOCATE 21, 31: PRINT SPC(40);
  172. 3580 x$ = INKEY$: IF x$ = "" THEN 3580
  173. IF ASC(x$) = 27 THEN PCOPY 1, 0: GOTO 500
  174. IF x$ = "1" THEN c$ = "210": b$ = "ENTRAGEN": GOTO 32000
  175. IF x$ = "2" THEN c$ = "220": b$ = "LISEXIST": GOTO 32000
  176. IF x$ = "3" THEN c$ = "230": b$ = "LISTAPRE": GOTO 32000
  177. IF x$ = "4" THEN c$ = "240": b$ = "LISPRECI": GOTO 32000
  178. IF x$ = "5" THEN c$ = "250": b$ = "ALBARANE": GOTO 32000
  179. IF x$ = "6" THEN c$ = "260": b$ = "LISALBCL": GOTO 32000
  180. IF x$ = "7" THEN c$ = "270": b$ = "LISTAKIL": GOTO 32000
  181. GOTO 3580
  182.  
  183. op3:
  184. '----------------------- VENTANA DE OPCION 3 ------------------------------
  185. COLOR 0, 2
  186. LOCATE 10, 30: PRINT " ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ» "
  187. LOCATE 11, 30: PRINT " º ";
  188. COLOR 15, 0
  189. PRINT "  3.- Cuadre de Venta.            ";
  190. COLOR 0, 2
  191. PRINT " º "
  192. LOCATE 12, 30: PRINT " ÇÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄĶ "
  193. LOCATE 13, 30: PRINT " º  1.- Listado por Art¡culos.        º "
  194. LOCATE 14, 30: PRINT " º  2.- Correcci¢n de Errores.        º "
  195. LOCATE 15, 30: PRINT " º  3.- Listado Total de Venta.       º "
  196. LOCATE 16, 30: PRINT " º  4.- Actualizar Venta.             º "
  197. LOCATE 17, 30: PRINT " º  5.- Listado por Art¡culos/Cliente.º "
  198. LOCATE 18, 30: PRINT " ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ "
  199. COLOR 7, 0
  200. FOR n% = 11 TO 18
  201.     LOCATE n%, 70: PRINT " "
  202. NEXT n%
  203. LOCATE 19, 31: PRINT SPC(40);
  204. IF op = 311 OR op = 312 THEN GOTO op31
  205. IF op = 351 OR op = 352 OR 353 THEN GOTO op35
  206. 4580 x$ = INKEY$: IF x$ = "" THEN 4580
  207. IF ASC(x$) = 27 THEN PCOPY 1, 0: GOTO 500
  208. IF x$ = "1" THEN GOTO op31
  209. IF x$ = "2" THEN c$ = "320": b$ = "ALTERAN": GOTO 32000
  210. IF x$ = "3" THEN c$ = "330": b$ = "LISTOT": GOTO 32000
  211. IF x$ = "4" THEN c$ = "340": b$ = "ACTUCAJA": GOTO 32000
  212. IF x$ = "5" THEN GOTO op35
  213. GOTO 4580
  214.  
  215. op31:
  216. '----------------------- VENTANA DE OPCION 3.1 ----------------------------
  217. PCOPY 0, 2
  218. COLOR 0, 6
  219. LOCATE 13, 40: PRINT " ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ» "
  220. LOCATE 14, 40: PRINT " º ";
  221. COLOR 15, 0
  222. PRINT "  3.1.- Listado por Art¡culos.    ";
  223. COLOR 0, 6
  224. PRINT " º "
  225. LOCATE 15, 40: PRINT " ÇÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄĶ "
  226. LOCATE 16, 40: PRINT " º  1.- Individual por Pantalla.      º "
  227. LOCATE 17, 40: PRINT " º  2.- Total por Impresora.          º "
  228. LOCATE 18, 40: PRINT " ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ "
  229. COLOR 7, 0
  230. FOR n% = 14 TO 18
  231.     LOCATE n%, 80: PRINT " "
  232. NEXT n%
  233. LOCATE 19, 41: PRINT SPC(40);
  234. 8580 x$ = INKEY$: IF x$ = "" THEN 8580
  235. IF ASC(x$) = 27 THEN op = 310: PCOPY 2, 0: GOTO 4580
  236. IF x$ = "1" THEN c$ = "311": b$ = "LISART": GOTO 32000
  237. IF x$ = "2" THEN c$ = "312": b$ = "LISART": GOTO 32000
  238. GOTO 8580
  239.  
  240. op35:
  241. '----------------------- VENTANA DE OPCION 3.5 ----------------------------
  242. PCOPY 0, 2
  243. COLOR 0, 6
  244. LOCATE 13, 40: PRINT " ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ» "
  245. LOCATE 14, 40: PRINT " º ";
  246. COLOR 15, 0
  247. PRINT "  3.5.- Listado por Art./Clientes.";
  248. COLOR 0, 6
  249. PRINT " º "
  250. LOCATE 15, 40: PRINT " ÇÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄĶ "
  251. LOCATE 16, 40: PRINT " º  1.- Individual por Pantalla.      º "
  252. LOCATE 17, 40: PRINT " º  2.- Individual por Impresora      º "
  253. LOCATE 18, 40: PRINT " º  3.- Total por Impresora.          º "
  254. LOCATE 19, 40: PRINT " ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ "
  255. COLOR 7, 0
  256. FOR n% = 14 TO 19
  257.     LOCATE n%, 80: PRINT " "
  258. NEXT n%
  259. LOCATE 20, 41: PRINT SPC(40);
  260. 9090 x$ = INKEY$: IF x$ = "" THEN 9090
  261. IF ASC(x$) = 27 THEN op = 320: PCOPY 2, 0: GOTO 4580
  262. IF x$ = "1" THEN c$ = "321": b$ = "LISARCLI": GOTO 32000
  263. IF x$ = "2" THEN c$ = "322": b$ = "LISARCLI": GOTO 32000
  264. IF x$ = "3" THEN c$ = "323": b$ = "LISARCLI": GOTO 32000
  265. GOTO 9090
  266.  
  267. op4:
  268. '---------------------- VENTANA DE OPCION 4 ------------------------------
  269. COLOR 0, 2
  270. LOCATE 10, 30: PRINT " ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ» "
  271. LOCATE 11, 30: PRINT " º ";
  272. COLOR 15, 0
  273. PRINT "  4.- Gesti¢n de Facturas.        ";
  274. COLOR 0, 2
  275. PRINT " º "
  276. LOCATE 12, 30: PRINT " ÇÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄĶ "
  277. LOCATE 13, 30: PRINT " º  1.- Facturacion.                  º "
  278. LOCATE 14, 30: PRINT " º  2.- Facturacion (Precios Medios). º "
  279. LOCATE 15, 30: PRINT " º  3.- Cambiar Estado de Facturas y  º "
  280. LOCATE 16, 30: PRINT " º      Reimprimir Facturas.          º "
  281. LOCATE 17, 30: PRINT " º  4.- Gestion de Facturas de Compra º "
  282. LOCATE 18, 30: PRINT " ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ "
  283. COLOR 7, 0
  284. FOR n% = 11 TO 18
  285.     LOCATE n%, 70: PRINT " "
  286. NEXT n%
  287. LOCATE 19, 31: PRINT SPC(40);
  288. 13080 x$ = INKEY$: IF x$ = "" THEN 13080
  289. IF ASC(x$) = 27 THEN PCOPY 1, 0: GOTO 500
  290. IF x$ = "1" THEN c$ = "410": b$ = "FACTURAS": GOTO 32000
  291. IF x$ = "2" THEN c$ = "420": b$ = "FACTURA2": GOTO 32000
  292. IF x$ = "3" THEN c$ = "430": b$ = "ANULACLI": GOTO 32000
  293. IF x$ = "4" THEN c$ = "440": b$ = "IVACOMPR": GOTO 32000
  294. GOTO 13080
  295.  
  296. op5:
  297. '----------------------- VENTANA DE OPCION 5 ------------------------------
  298. COLOR 0, 2
  299. LOCATE 10, 30: PRINT " ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ» "
  300. LOCATE 11, 30: PRINT " º ";
  301. COLOR 15, 0
  302. PRINT "  5.- Gesti¢n de Impuestos.              ";
  303. COLOR 0, 2
  304. PRINT " º "
  305. LOCATE 12, 30: PRINT " ÇÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄĶ "
  306. LOCATE 13, 30: PRINT " º  1.- Listado I.V.A. de Clientes.          º "
  307. LOCATE 14, 30: PRINT " º  2.- Listado Anual Ventas a Clientes.     º "
  308. LOCATE 15, 30: PRINT " º  3.- Listado Anual Compras a Proveedores. º "
  309. LOCATE 16, 30: PRINT " º  4.- Listado Facturas de Clientes.        º "
  310. LOCATE 17, 30: PRINT " ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ "
  311. COLOR 7, 0
  312. FOR n% = 11 TO 17
  313.     LOCATE n%, 77: PRINT " "
  314. NEXT n%
  315. LOCATE 18, 31: PRINT SPC(47);
  316. 8080 x$ = INKEY$: IF x$ = "" THEN 8080
  317. IF ASC(x$) = 27 THEN PCOPY 1, 0: GOTO 500
  318. IF x$ = "1" THEN c$ = "510": b$ = "LISIVACL": GOTO 32000
  319. IF x$ = "2" THEN c$ = "520": b$ = "LISBASCL": GOTO 32000
  320. IF x$ = "3" THEN c$ = "530": b$ = "LISBASPR": GOTO 32000
  321. IF x$ = "4" THEN c$ = "540": b$ = "LISCLIFA": GOTO 32000
  322. GOTO 8080
  323.  
  324. op6:
  325. '---------------------- VENTANA DE OPCION 6 ------------------------------
  326. COLOR 0, 2
  327. LOCATE 10, 30: PRINT " ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ» "
  328. LOCATE 11, 30: PRINT " º ";
  329. COLOR 15, 0
  330. PRINT "  6.- Arqueo y Final.             ";
  331. COLOR 0, 2
  332. PRINT " º "
  333. LOCATE 12, 30: PRINT " ÇÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄĶ "
  334. LOCATE 13, 30: PRINT " º  1.- Arqueo de Caja.               º "
  335. LOCATE 14, 30: PRINT " º  2.- Borrado de Datos de Hoy y     º "
  336. LOCATE 15, 30: PRINT " º      Preparaci¢n para Ma¤ana.      º "
  337. LOCATE 16, 30: PRINT " º  3.- Consulta de Arqueos de Caja.  º "
  338. LOCATE 17, 30: PRINT " ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ "
  339. COLOR 7, 0
  340. FOR n% = 11 TO 17
  341.     LOCATE n%, 70: PRINT " "
  342. NEXT n%
  343. LOCATE 18, 31: PRINT SPC(40);
  344. 13580 x$ = INKEY$: IF x$ = "" THEN 13580
  345. IF ASC(x$) = 27 THEN PCOPY 1, 0: GOTO 500
  346. IF x$ = "1" THEN c$ = "610": b$ = "ARQUEO": GOTO 32000
  347. IF x$ = "2" THEN c$ = "620": b$ = "BORRAR": GOTO 32000
  348. IF x$ = "3" THEN c$ = "630": b$ = "HISARQUE": GOTO 32000
  349. GOTO 13580
  350.  
  351. op7:
  352. '---------------------------- VENTANA DE PROGRAMAS AUXILIARES -------------------
  353. COLOR 0, 2
  354. LOCATE 10, 30: PRINT " ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ» "
  355. LOCATE 11, 30: PRINT " º ";
  356. COLOR 15, 0
  357. PRINT "  7.- Programas Auxiliares         ";
  358. COLOR 0, 2
  359. PRINT " º "
  360. LOCATE 12, 30: PRINT " ÇÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄĶ "
  361. LOCATE 13, 30: PRINT " º  1.- Obt. C. de Seg. a Pendrive.    º "
  362. LOCATE 14, 30: PRINT " º  2.- Res. C. de Seg. desde Pendrive.º "
  363. LOCATE 15, 30: PRINT " º  3.- Impresora Predeterminada.      º "
  364. LOCATE 16, 30: PRINT " º  4.- Utilidades.                    º "
  365. LOCATE 17, 30: PRINT " º                                     º "
  366. LOCATE 18, 30: PRINT " º  0.- Crear un NUEVO PERIODO.        º "
  367. LOCATE 19, 30: PRINT " ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ "
  368. COLOR 7, 0
  369. FOR n% = 11 TO 19
  370.     LOCATE n%, 71: PRINT " "
  371. NEXT n%
  372. LOCATE 20, 31: PRINT SPC(41);
  373. 1580 x$ = INKEY$: IF x$ = "" THEN 1580
  374. IF ASC(x$) = 27 THEN PCOPY 1, 0: GOTO 500
  375. IF x$ = "1" THEN GOTO op71
  376. IF x$ = "2" THEN GOTO op72
  377. IF x$ = "3" THEN CALL predeter(impresora$)
  378. IF x$ = "4" THEN c$ = "740": b$ = "UTILALM": GOTO 32000
  379. IF x$ = "0" THEN c$ = "790": b$ = "NPERIODO": GOTO 32000
  380. GOTO 1580
  381.  
  382. op71:
  383. '--------------------- OBTENER COPIA DE SEGURIDAD -------------------------
  384. PCOPY 0, 2
  385. COLOR 0, 6
  386. LOCATE 13, 40: PRINT " ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ» "
  387. LOCATE 14, 40: PRINT " º ";
  388. COLOR 15, 0
  389. PRINT " 7.1.- Obtener Copia de Seguridad ";
  390. COLOR 0, 6
  391. PRINT " º "
  392. LOCATE 15, 40: PRINT " ÇÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄĶ "
  393. LOCATE 16, 40: PRINT " º                                    º "
  394. LOCATE 17, 40: PRINT " º PenDrive...(D,E,F,G,etc):          º "
  395. LOCATE 18, 40: PRINT " º                                    º "
  396. LOCATE 19, 40: PRINT " ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ "
  397. COLOR 7, 0
  398. FOR n% = 14 TO 20
  399.     LOCATE n%, 80: PRINT " "
  400. NEXT n%
  401. LOCATE 20, 41: PRINT SPC(40);
  402. COLOR 15, 0
  403. 2660 y = 17: x = 69: a$ = "": l = 1: sp = 1: nu$ = "T"
  404. CALL rutimput(y, x, a$, l, ant, sp, nu$)
  405. IF ant = 2 THEN
  406.     PCOPY 2, 0
  407.     GOTO 1580
  408. a$ = UCASE$(a$)
  409. IF a$ <> "" THEN
  410.     disco = INSTR("DEFGHIJKLMN¥OPQRSTUVWXYZ", a$)
  411.     IF disco = 0 THEN GOTO 2660
  412.  
  413. backu$ = "CMD /C c:\almav10\mysqldump -v --host=" + servidor$ + " --user=" + usuario$ + " --password=" + clave$ + " --port=" + LTRIM$(STR$(puerto)) + " --add-drop-database --databases " + bdatos$ + " > " + a$ + ":" + "COPIA" + bdatos$ + ".sql"
  414. COLOR 15, 0
  415. PRINT "********************************************************************************"
  416. PRINT "*************** HACIENDO COPIA DE SEGURIDAD DE LA BASE DE DATOS ****************"
  417. PRINT "********************************************************************************"
  418. SHELL backu$
  419.  
  420. IF _DIREXISTS("c:\ALMAv10\ARCHIVOS") THEN
  421.     PRINT "********************************************************************************"
  422.     PRINT "************* HACIENDO COPIA DE SEGURIDAD DE LA CARPETA 'ARCHIVOS' *************"
  423.     PRINT "********************************************************************************"
  424.     backu$ = "CMD /C XCOPY c:\ALMAv10\ARCHIVOS\*.* " + a$ + ":\ARCHIVOS\ /Y /V /S /E"
  425.     SHELL backu$
  426.  
  427. 2680 COLOR 25, 7
  428. PRINT "                             PULSE UNA TECLA PARA CONTINUAR                  ";
  429. x$ = INPUT$(1): x$ = ""
  430. COLOR 7, 0
  431. PCOPY 2, 0
  432. GOTO 1580
  433.  
  434. op72:
  435. '----------------------- VENTANA DATOS DE RESTORE -------------------------
  436. PCOPY 0, 2
  437. COLOR 7, 4
  438. LOCATE 13, 40: PRINT " ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ» "
  439. LOCATE 14, 40: PRINT " º ";
  440. COLOR 15, 0
  441. PRINT " 7.2.-Restaurar Copia de Seguridad";
  442. COLOR 7, 4
  443. PRINT " º "
  444. LOCATE 15, 40: PRINT " ÇÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄĶ "
  445. LOCATE 16, 40: PRINT " º                                    º "
  446. LOCATE 17, 40: PRINT " º Pendrive...(D,E,F,G,etc):          º "
  447. LOCATE 18, 40: PRINT " º                                    º "
  448. LOCATE 19, 40: PRINT " ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ "
  449. COLOR 7, 0
  450. FOR n% = 14 TO 19
  451.     LOCATE n%, 80: PRINT " "
  452. NEXT n%
  453. LOCATE 20, 41: PRINT SPC(40);
  454. COLOR 15, 0
  455. 3010 y = 17: x = 69: a$ = "": l = 1: sp = 1: nu$ = "T"
  456. CALL rutimput(y, x, a$, l, ant, sp, nu$)
  457. IF ant = 2 THEN
  458.     PCOPY 2, 0
  459.     GOTO 1580
  460. a$ = UCASE$(a$)
  461. IF a$ <> "" THEN
  462.     disco = INSTR("DEFGHIJKLMN¥OPQRSTUVWXYZ", a$)
  463.     IF disco = 0 THEN GOTO 2660
  464.  
  465. resto$ = "CMD /C c:\almav10\mysql -v --host=" + servidor$ + " --user=" + usuario$ + " --password=" + clave$ + " --port=" + LTRIM$(STR$(puerto)) + " " + bdatos$ + " < " + a$ + ":" + "COPIA" + bdatos$ + ".sql"
  466.  
  467. COLOR 15, 0
  468. COLOR 15, 0
  469. PRINT "********************************************************************************"
  470. PRINT "***********  RESTAURANDO COPIA DE SEGURIDAD DE LA BASE DE DATOS ****************"
  471. PRINT "********************************************************************************"
  472. SHELL resto$
  473. IF _DIREXISTS(a$ + ":\ARCHIVOS") THEN
  474.     PRINT "********************************************************************************"
  475.     PRINT "********** RESTAURANDO COPIA DE SEGURIDAD DE LA CARPETA 'ARCHIVOS' *************"
  476.     PRINT "********************************************************************************"
  477.     backu$ = "CMD /C XCOPY " + a$ + ":\ARCHIVOS\*.* c:\ALMAv10\ARCHIVOS\ /Y /V /S /E"
  478.     SHELL backu$
  479.  
  480. COLOR 25, 7
  481. PRINT "                             PULSE UNA TECLA PARA CONTINUAR                     ";
  482. x$ = INPUT$(1): x$ = ""
  483. COLOR 7, 0
  484. PCOPY 2, 0
  485. GOTO 1580
  486.  
  487.  
  488. 2000 '----------------------- VENTANA DE SALIR DEL PROGRAMA --------------------
  489. COLOR 7, 4
  490. LOCATE 10, 30: PRINT " ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ» "
  491. LOCATE 11, 30: PRINT " º ";
  492. COLOR 15, 0
  493. PRINT "  <Esc> Salir del Programa.       ";
  494. COLOR 7, 4
  495. PRINT " º "
  496. LOCATE 12, 30: PRINT " ÇÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄĶ "
  497. LOCATE 13, 30: PRINT " º  NO SE OLVIDE DE OBTENER UNA COPIA º "
  498. LOCATE 14, 30: PRINT " º  DE  SEGURIDAD SI SE HA MODIFICADO º "
  499. LOCATE 15, 30: PRINT " º  ALGUN DATO.                       º "
  500. LOCATE 16, 30: PRINT " º                                    º "
  501. LOCATE 17, 30: PRINT " º    ¨ABANDONA EL PROGRAMA (S/N)?    º "
  502. LOCATE 18, 30: PRINT " ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ "
  503. COLOR 7, 0
  504. FOR n% = 11 TO 18
  505.     LOCATE n%, 70: PRINT " "
  506. NEXT n%
  507. LOCATE 19, 31: PRINT SPC(40);
  508.     x$ = UCASE$(INPUT$(1))
  509.     IF x$ = "S" OR x$ = "N" THEN EXIT DO
  510. IF x$ = "N" THEN PCOPY 1, 0: GOTO 500
  511. IF _FILEEXISTS("c:\ALMAv10\SERVIDOR.DAT") THEN
  512.     KILL "c:\ALMAv10\SERVIDOR.DAT"
  513. busclave$ = "UPDATE const SET controlmenu= '000' WHERE id= '1'"
  514. CALL basedato(busclave$, rows, columns)
  515. mysql_close (conn) '-- Cerrar Base de Datos
  516. COLOR 7, 0: CLS
  517.  
  518. 15000 '----------------------- RUTINA DE ERROR -------------------------------
  519. _FONT 16 'change to the QB64 default font to free it
  520. COLOR 7, 0
  521. COLOR 15, 4
  522. LOCATE 8, 23: PRINT " ÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜ "
  523. LOCATE 9, 23: PRINT " Û                              Û "
  524. LOCATE 10, 23: PRINT USING " Û   ERROR ### en Linea #####   Û "; ERR; _ERRORLINE 'ERL
  525. LOCATE 11, 23: PRINT " Û                              Û "
  526. LOCATE 12, 23: PRINT " Û     ­ SISTEMA PARADO !       Û "
  527. LOCATE 13, 23: PRINT " Û                              Û "
  528. LOCATE 14, 23: PRINT " Û  Pulse una tecla para volver Û "
  529. LOCATE 15, 23: PRINT " Û  a COMENZAR.                 Û "
  530. LOCATE 16, 23: PRINT " Û                              Û "
  531. LOCATE 17, 23: PRINT " ßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßß "
  532. COLOR 7, 0
  533. x$ = INPUT$(1)
  534. RESUME 100
  535.  
  536. 17000 '--------------------------- RELOJ ---------------------------------------
  537. COLOR 7, 1
  538. LOCATE 25, 70: PRINT TIME$;
  539. COLOR 15, 0
  540.  
  541. 32000 '----------------------- ENTRAR EN OTRO PROGRAMA -----------------------
  542. IF impresora$ <> "" THEN
  543.     SHELL _HIDE "cmd/c wmic printer where name='" + impresora$ + "' call setdefaultprinter"
  544. COLOR 7, 0, 0: CLS
  545. LOCATE 12, 20: PRINT "Procesando......"
  546. busclave$ = "UPDATE const SET controlmenu= '" + c$ + "' WHERE id= '1'"
  547. CALL basedato(busclave$, rows, columns)
  548. 32010 mysql_close (conn) '-- Cerrar Base de Datos
  549. b$ = "\ALMAv10\" + b$: CHAIN b$
  550.  
  551. '-----------------------------------------------------------------------------------------------------------------------------
  552. '----------------------------------------------------------- RUTINAS ---------------------------------------------------------
  553. '-----------------------------------------------------------------------------------------------------------------------------
  554. ' $include: 'RUTIN10v1.bas'

y las rutinas del $include

Code: QB64: [Select]
  1. DECLARE CUSTOMTYPE LIBRARY "mysql_helper"
  2.     FUNCTION offset_to_string$ ALIAS offset_to_offset (BYVAL offset AS _OFFSET)
  3.     FUNCTION offset_at_offset%& (BYVAL offset AS _OFFSET)
  4.  
  5. '#### download mysql.dll from http://www.[abandoned, outdated and now likely malicious qb64 dot net website - don’t go there]/mysql.dll (~2MB) ####
  6.     FUNCTION mysql_init%& (BYVAL always_0 AS _OFFSET)
  7.     FUNCTION mysql_error$ (BYVAL mysql AS _OFFSET)
  8.     FUNCTION mysql_get_client_info$
  9.     FUNCTION mysql_real_connect%& (BYVAL mysql AS _OFFSET, host AS STRING, user AS STRING, password AS STRING, db AS STRING, BYVAL port AS _UNSIGNED LONG, BYVAL unix_socket AS _OFFSET, BYVAL client_flag AS _UNSIGNED _OFFSET)
  10.     FUNCTION mysql_real_connect_dont_open%& ALIAS mysql_real_connect (BYVAL mysql AS _OFFSET, host AS STRING, user AS STRING, password AS STRING, BYVAL db AS _OFFSET, BYVAL port AS _UNSIGNED LONG, BYVAL unix_socket AS _OFFSET, BYVAL client_flag AS _UNSIGNED LONG)
  11.     SUB mysql_query (BYVAL mysql AS _OFFSET, mysql_command AS STRING)
  12.     FUNCTION mysql_query& (BYVAL mysql AS _OFFSET, mysql_command AS STRING)
  13.     FUNCTION mysql_store_result%& (BYVAL mysql AS _OFFSET)
  14.     FUNCTION mysql_num_fields~& (BYVAL result AS _OFFSET)
  15.     FUNCTION mysql_num_rows&& (BYVAL result AS _OFFSET)
  16.     FUNCTION mysql_fetch_row%& (BYVAL result AS _OFFSET)
  17.     FUNCTION mysql_fetch_lengths%& (BYVAL result AS _OFFSET)
  18.     SUB mysql_close (BYVAL mysql AS _OFFSET)
  19.     SUB mysql_free_result (BYVAL result AS _OFFSET)
  20.  
  21.  
  22. '----------------------------------------------------------- MYSQL -----------------------------------------------------------
  23. SUB basedato (busclave$, rows, columns)
  24.     '*** Hacer busqueda en la tabla ***
  25.     errf = mysql_query(conn, busclave$)
  26.     DIM result AS _OFFSET
  27.     'DIM columns AS LONG
  28.     result = mysql_store_result(conn)
  29.     IF LEFT$(busclave$, 6) = "SELECT" THEN
  30.         'DIM row AS _OFFSET
  31.         'DIM dato AS _OFFSET
  32.         columns = mysql_num_fields(result)
  33.         rows = mysql_num_rows(result)
  34.         '*** Guardar en Array ***
  35.         REDIM DB_RESULT(columns, rows) AS STRING
  36.         FOR filas = 1 TO rows
  37.             DIM mysql_row AS _OFFSET
  38.             mysql_row = mysql_fetch_row(result)
  39.             DIM mem_mysql_row AS _MEM
  40.             mem_mysql_row = _MEM(mysql_row, columns * LEN(an_offset%&)) 'The upper limit is unknown at this point
  41.             DIM mysql_lengths AS _OFFSET
  42.             mysql_lengths = mysql_fetch_lengths(result)
  43.             DIM mem_mysql_lengths AS _MEM
  44.             mem_mysql_lengths = _MEM(mysql_lengths, columns * 4)
  45.             DIM mem_field AS _MEM
  46.             FOR campos = 1 TO columns
  47.                 length = _MEMGET(mem_mysql_lengths, mem_mysql_lengths.OFFSET + (campos - 1) * 4, _UNSIGNED LONG)
  48.                 mem_field = _MEM(_MEMGET(mem_mysql_row, mem_mysql_row.OFFSET + (campos - 1) * LEN(an_offset%&), _OFFSET), length)
  49.                 DB_RESULT(campos, filas) = SPACE$(length)
  50.                 _MEMGET mem_field, mem_field.OFFSET, DB_RESULT(campos, filas)
  51.                 _MEMFREE mem_field
  52.             NEXT
  53.             _MEMFREE mem_mysql_lengths
  54.             _MEMFREE mem_mysql_row
  55.         NEXT
  56.     END IF
  57.     mysql_free_result result
  58.  
  59. SUB calcif (a$)
  60.     '------------------- CALCULAR LETRA CIF -------------------------------
  61.     IF LEN(a$) < 9 THEN
  62.         DIM cif$(24)
  63.         cif$(1) = "03A": cif$(2) = "11B": cif$(3) = "20C": cif$(4) = "09D"
  64.         cif$(5) = "22E": cif$(6) = "07F": cif$(7) = "04G": cif$(8) = "18H"
  65.         cif$(9) = "13J": cif$(10) = "21K": cif$(11) = "19L": cif$(12) = "05M"
  66.         cif$(13) = "12N": cif$(14) = "08P": cif$(15) = "16Q": cif$(16) = "01R"
  67.         cif$(17) = "15S": cif$(18) = "00T": cif$(19) = "23T": cif$(20) = "17V"
  68.         cif$(21) = "02W": cif$(22) = "10X": cif$(23) = "06Y": cif$(24) = "14Z"
  69.         a# = VAL(a$): b# = a# / 23: c# = INT(b#) * 23: d = a# - c#
  70.         FOR m = 1 TO 24
  71.             IF VAL(LEFT$(cif$(m), 2)) = d THEN
  72.                 a$ = a$ + RIGHT$(cif$(m), 1): EXIT FOR
  73.             END IF
  74.         NEXT m
  75.     END IF
  76.  
  77. SUB calcu (a$)
  78.     '----------- CALCULADORA ----------------------------------------------------
  79.     PCOPY 0, 3
  80.     DIM calcures$(16)
  81.     FOR ncalcures% = 1 TO 14: calcures$(ncalcures%) = STRING$(16, "°"): NEXT
  82.     calcures$(15) = SPACE$(16): calcures$(16) = SPACE$(16)
  83.     a$ = "": b# = 0: memo# = 0: tip$ = "="
  84.     COLOR 1, 7
  85.     LOCATE 2, 2: PRINT "ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍËÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»"
  86.     LOCATE 3, 2: PRINT "ºÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ºÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿º"
  87.     LOCATE 4, 2: PRINT "º³                ³º³               ³º"
  88.     LOCATE 5, 2: PRINT "º³                ³ºÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙº"
  89.     LOCATE 6, 2: PRINT "º³                ³º                 º"
  90.     LOCATE 7, 2: PRINT "º³                ³º                 º"
  91.     LOCATE 8, 2: PRINT "º³                ³º                 º"
  92.     LOCATE 9, 2: PRINT "º³                ³º                 º"
  93.     LOCATE 10, 2: PRINT "º³                ³º                 º"
  94.     LOCATE 11, 2: PRINT "º³                ³º                 º"
  95.     LOCATE 12, 2: PRINT "º³                ³º                 º"
  96.     LOCATE 13, 2: PRINT "º³                ³º                 º"
  97.     LOCATE 14, 2: PRINT "º³                ³º                 º"
  98.     LOCATE 15, 2: PRINT "º³                ³º                 º"
  99.     LOCATE 16, 2: PRINT "º³                ³º                 º"
  100.     LOCATE 17, 2: PRINT "º³                ³º                 º"
  101.     LOCATE 18, 2: PRINT "º³                ³º                 º"
  102.     LOCATE 19, 2: PRINT "º³                ³º                 º"
  103.     LOCATE 20, 2: PRINT "ºÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙº                 º"
  104.     LOCATE 21, 2: PRINT "ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÊÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ"
  105.     COLOR 7, 1
  106.     LOCATE 6, 29: PRINT "ÚÄ¿ÚÄ¿ÚÄ¿"
  107.     LOCATE 7, 29: PRINT "³/³³*³³-³"
  108.     LOCATE 8, 29: PRINT "ÀÄÙÀÄÙÀÄÙ"
  109.     LOCATE 9, 23: COLOR 7, 4: PRINT "ÚÄ¿";: COLOR 7, 0: PRINT "ÚÄ¿ÚÄ¿ÚÄ¿";: COLOR 7, 1: PRINT "ÚÄ¿"
  110.     LOCATE 10, 23: COLOR 7, 4: PRINT "³C³";: COLOR 7, 0: PRINT "³7³³8³³9³";: COLOR 7, 1: PRINT "³ ³"
  111.     LOCATE 11, 23: COLOR 7, 4: PRINT "ÀÄÙ";: COLOR 7, 0: PRINT "ÀÄÙÀÄÙÀÄÙ";: COLOR 7, 1: PRINT "³+³"
  112.     LOCATE 12, 23: COLOR 7, 4: PRINT "ÚÄ¿";: COLOR 7, 0: PRINT "ÚÄ¿ÚÄ¿ÚÄ¿";: COLOR 7, 1: PRINT "³ ³"
  113.     LOCATE 13, 23: COLOR 7, 4: PRINT "³E³";: COLOR 7, 0: PRINT "³4³³5³³6³";: COLOR 7, 1: PRINT "³ ³"
  114.     LOCATE 14, 23: COLOR 7, 4: PRINT "ÀÄÙ";: COLOR 7, 0: PRINT "ÀÄÙÀÄÙÀÄÙ";: COLOR 7, 1: PRINT "ÀÄÙ"
  115.     LOCATE 15, 23: COLOR 7, 1: PRINT "ÚÄ¿";: COLOR 7, 0: PRINT "ÚÄ¿ÚÄ¿ÚÄ¿";: COLOR 7, 1: PRINT "ÚÄ¿"
  116.     LOCATE 16, 23: COLOR 7, 1: PRINT "³T³";: COLOR 7, 0: PRINT "³1³³2³³3³";: COLOR 7, 1: PRINT "³ ³"
  117.     LOCATE 17, 23: COLOR 7, 1: PRINT "³r³";: COLOR 7, 0: PRINT "ÀÄÙÀÄÙÀÄÙ";: COLOR 7, 1: PRINT "³=³"
  118.     LOCATE 18, 23: COLOR 7, 1: PRINT "³a³";: COLOR 7, 0: PRINT "ÚÄÄÄÄ¿ÚÄ¿";: COLOR 7, 1: PRINT "³ ³"
  119.     LOCATE 19, 23: COLOR 7, 1: PRINT "³n³";: COLOR 7, 0: PRINT "³  0 ³³.³";: COLOR 7, 1: PRINT "³ ³"
  120.     LOCATE 20, 23: COLOR 7, 1: PRINT "ÀÄÙ";: COLOR 7, 0: PRINT "ÀÄÄÄÄÙÀÄÙ";: COLOR 7, 1: PRINT "ÀÄÙ"
  121.     COLOR 1, 7
  122.     LOCATE 3, 3: PRINT "ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿"
  123.     FOR n = 4 TO 19
  124.         LOCATE n, 3: PRINT "³"; STRING$(16, "°"); "³"
  125.     NEXT n
  126.     LOCATE 20, 3: PRINT "ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ"
  127.     COLOR 10, 0
  128.     DO
  129.         LOCATE 4, 23: PRINT USING "###,###,###.##"; VAL(a$);: PRINT tip$
  130.        10 x$ = "": WHILE x$ = "": x$ = INKEY$: WEND
  131.         IF ASC(x$) = 27 THEN
  132.             a$ = ""
  133.             PCOPY 3, 0
  134.             COLOR 15, 0: EXIT SUB
  135.         END IF
  136.         IF ASC(x$) = 13 OR x$ = "*" OR x$ = "/" OR x$ = "+" OR x$ = "-" THEN GOSUB opera: GOTO 10
  137.         IF x$ = "T" OR x$ = "t" THEN
  138.             a$ = LTRIM$(STR$(INT(b# * 100) / 100))
  139.             PCOPY 3, 0
  140.             COLOR 15, 0
  141.             EXIT SUB
  142.         END IF
  143.         IF x$ = "E" OR x$ = "e" THEN
  144.             a$ = ""
  145.         ELSE
  146.             IF x$ = "C" OR x$ = "c" THEN
  147.                 b# = 0: a$ = "": tip$ = "="
  148.                 GOSUB imprime
  149.             ELSE
  150.                 IF LEN(a$) < 9 THEN
  151.                     c$ = a$: a$ = x$: CALL nonum(a$, bien): a$ = c$
  152.                     IF bien <> 0 THEN
  153.                         a$ = a$ + x$
  154.                     END IF
  155.                 END IF
  156.             END IF
  157.         END IF
  158.     LOOP
  159.  
  160.     opera:
  161.     SELECT CASE tip$
  162.         CASE "="
  163.             IF memo# <> 0 AND a$ = "" THEN
  164.                 b# = memo#: memo# = 0
  165.             ELSE
  166.                 b# = VAL(a$)
  167.             END IF
  168.         CASE "+"
  169.             IF LEN(a$) <> 0 THEN b# = b# + VAL(a$)
  170.         CASE "-"
  171.             IF LEN(a$) <> 0 THEN b# = b# - VAL(a$)
  172.         CASE "*"
  173.             IF LEN(a$) <> 0 THEN b# = b# * VAL(a$)
  174.         CASE "/"
  175.             IF VAL(a$) <> 0 THEN b# = INT(b# * 100 / VAL(a$)) / 100 ELSE b# = 0: tip$ = "=": memo# = 0: LOCATE 3, 22: PRINT "Desbordamiento": GOSUB imprime: GOTO 40
  176.     END SELECT
  177.     tip$ = x$
  178.     IF x$ = CHR$(13) THEN tip$ = "=": memo# = b#
  179.     IF b# > 999999999.99# THEN
  180.         b# = 0: tip$ = "=": memo# = 0: LOCATE 4, 23: PRINT "Desbordamiento"
  181.         GOSUB imprime: GOTO 40
  182.     ELSE
  183.         LOCATE 4, 23: PRINT USING "###,###,###.##"; b#;: PRINT tip$
  184.         GOSUB imprime
  185.     END IF
  186.    40 a$ = ""
  187.     RETURN
  188.  
  189.     imprime:
  190.     COLOR 0, 7
  191.     FOR ncalcures% = 1 TO 15
  192.         SWAP calcures$(ncalcures%), calcures$(ncalcures% + 1)
  193.     NEXT
  194.     IF LEN(a$) <> 0 THEN
  195.         CALL converprin(a$, 14)
  196.         calcures$(16) = a$ + " " + tip$
  197.     ELSE
  198.         a$ = LTRIM$(STR$(b#))
  199.         CALL converprin(a$, 14)
  200.         calcures$(16) = a$ + " " + tip$
  201.     END IF
  202.     'CALL scroll(tipo$, nlin, y1, x1, y2, x2, colo)
  203.     'LOCATE 19, 4: PRINT " Û              "
  204.     IF tip$ = "=" THEN
  205.         FOR ncalcures% = 1 TO 14
  206.             SWAP calcures$(ncalcures%), calcures$(ncalcures% + 2)
  207.         NEXT
  208.         a$ = LTRIM$(STR$(b#))
  209.         CALL converprin(a$, 14)
  210.         calcures$(15) = a$ + " T"
  211.         calcures$(16) = SPACE$(16)
  212.     END IF
  213.     FOR ncalcures% = 1 TO 16
  214.         IF calcures$(ncalcures%) = STRING$(16, "°") THEN
  215.             COLOR 1, 7
  216.         ELSE
  217.             IF MID$(calcures$(ncalcures%), 16, 1) <> "T" THEN COLOR 0, 7 ELSE COLOR 4, 7
  218.         END IF
  219.         LOCATE ncalcures% + 3, 4: PRINT calcures$(ncalcures%)
  220.     NEXT
  221.     COLOR 10, 0
  222.     RETURN
  223.  
  224.  
  225. SUB colpos (y, x, colo1, colo2)
  226.     '-------------------------------- OBTENER COLOR DE FONDO Y TEXTO DE UNA POSICION DE PANTALLA ---------------------------
  227.     b = (y - 1) * 160 + (x - 1) * 2 + 1
  228.     DEF SEG = VAL("&HB800")
  229.     a = PEEK(b)
  230.     DEF SEG
  231.     a$ = ""
  232.     FOR n = 1 TO 8
  233.         b = a / 2: c = INT(a / 2)
  234.         IF c <> b THEN a$ = "1" + a$ ELSE a$ = "0" + a$
  235.         a = c
  236.     NEXT n
  237.     colo1 = 0 - 1 * (VAL(MID$(a$, 8, 1)) = 1) - 2 * (VAL(MID$(a$, 7, 1)) = 1) - 4 * (VAL(MID$(a$, 6, 1)) = 1) - 8 * (VAL(MID$(a$, 5, 1)) = 1) - 16 * (VAL(MID$(a$, 1, 1)) = 1)
  238.     colo2 = 0 - 1 * (VAL(MID$(a$, 4, 1)) = 1) - 2 * (VAL(MID$(a$, 3, 1)) = 1) - 4 * (VAL(MID$(a$, 2, 1)) = 1)
  239.  
  240. SUB comfecha (a$)
  241.     '------------------------ COMPROBAR FECHA REAL -------------------------------
  242.     CALL nonum(a$, bien): IF bien = 0 THEN EXIT SUB
  243.     IF INSTR(a$, ".") <> 0 OR INSTR(a$, "-") <> 0 THEN a$ = "": EXIT SUB
  244.     IF LEN(a$) < 6 THEN a$ = "": EXIT SUB
  245.     aa = VAL(RIGHT$(a$, 2))
  246.     IF aa < 4 THEN
  247.         IF aa = 0 THEN bis = 1 ELSE bis = 0: '--- a¤o 2001 al 2003
  248.     ELSE
  249.         bis = 0: IF INT(aa / 4) = (aa / 4) THEN bis = 1
  250.     END IF
  251.     mm = VAL(MID$(a$, 3, 2)): IF mm < 1 OR mm > 12 THEN a$ = "": EXIT SUB
  252.     dd = VAL(LEFT$(a$, 2)): IF dd < 1 OR dd > 31 THEN a$ = "": EXIT SUB
  253.     IF dd > 28 AND mm = 2 AND bis = 0 THEN a$ = "": EXIT SUB
  254.     IF dd > 29 AND mm = 2 THEN a$ = "": EXIT SUB
  255.     IF (mm = 4 OR mm = 6 OR mm = 9 OR mm = 11) AND dd > 30 THEN
  256.         a$ = "": EXIT SUB
  257.     END IF
  258.  
  259. SUB convercero (a$, b)
  260.     '------------------------------- CONVERTIR EN CADENA CON CEROS A LA IZQUIERDA Y 2 DECIMALES ---------------------------------------
  261.     IF VAL(a$) <> 0 THEN
  262.         IF VAL(a$) < 100000 THEN
  263.             c = VAL(a$)
  264.             d = c * 100 + .5
  265.             a = INT(d)
  266.             a$ = LTRIM$(STR$(a))
  267.         ELSE
  268.             c# = VAL(a$)
  269.             d# = c# * 100 + .5
  270.             a# = INT(d#)
  271.             a$ = LTRIM$(STR$(a#))
  272.         END IF
  273.         IF LEN(a$) = 1 THEN
  274.             a$ = "0.0" + a$
  275.         ELSEIF LEN(a$) = 2 THEN
  276.             IF VAL(a$) < 0 THEN
  277.                 a$ = "-0.0" + RIGHT$(a$, 1)
  278.             ELSE
  279.                 a$ = "0." + a$
  280.             END IF
  281.         ELSEIF LEN(a$) = 3 AND VAL(a$) < 0 THEN
  282.             a$ = "-0." + RIGHT$(a$, 2)
  283.         ELSE
  284.             a$ = LEFT$(a$, LEN(a$) - 2) + "." + RIGHT$(a$, 2)
  285.         END IF
  286.     ELSE
  287.         a$ = "0.00"
  288.     END IF
  289.     a = b - LEN(a$)
  290.     IF a > 0 THEN
  291.         a$ = STRING$(a, "0") + a$
  292.     END IF
  293.  
  294. SUB convertir (a$, b)
  295.     '----------------------------------------- CONVERTIR EN CADENA CON ESPACIOS A LA IZQUIERDA Y 2 DECIMALES -----------------------
  296.     IF VAL(a$) <> 0 THEN
  297.         IF VAL(a$) < 100000 THEN
  298.             c = VAL(a$)
  299.             d = c * 100 + .5
  300.             a = INT(d)
  301.             a$ = LTRIM$(STR$(a))
  302.         ELSE
  303.             c# = VAL(a$)
  304.             d# = c# * 100 + .5
  305.             a# = INT(d#)
  306.             a$ = LTRIM$(STR$(a#))
  307.         END IF
  308.         IF LEN(a$) = 1 THEN
  309.             a$ = "0.0" + a$
  310.         ELSEIF LEN(a$) = 2 THEN
  311.             IF VAL(a$) < 0 THEN
  312.                 a$ = "-0.0" + RIGHT$(a$, 1)
  313.             ELSE
  314.                 a$ = "0." + a$
  315.             END IF
  316.         ELSEIF LEN(a$) = 3 AND VAL(a$) < 0 THEN
  317.             a$ = "-0." + RIGHT$(a$, 2)
  318.         ELSE
  319.             a$ = LEFT$(a$, LEN(a$) - 2) + "." + RIGHT$(a$, 2)
  320.         END IF
  321.     ELSE
  322.         a$ = "0.00"
  323.     END IF
  324.     a = b - LEN(a$)
  325.     IF a > 0 THEN
  326.         a$ = SPACE$(a) + a$
  327.     END IF
  328.  
  329. SUB converprin (a$, b)
  330.     '----------------------------------------- CONVERTIR NUMERO CON SEPARADORES DE MILES  Y 2 DECIMALES -----------------------
  331.     IF VAL(a$) <> 0 THEN
  332.         c# = VAL(a$)
  333.         d# = c# * 100 + .5
  334.         a# = INT(d#)
  335.         a$ = LTRIM$(STR$(a#))
  336.         IF LEN(a$) = 1 THEN
  337.             a$ = "0.0" + a$
  338.         ELSEIF LEN(a$) = 2 THEN
  339.             IF VAL(a$) < 0 THEN
  340.                 a$ = "-0.0" + RIGHT$(a$, 1)
  341.             ELSE
  342.                 a$ = "0." + a$
  343.             END IF
  344.         ELSEIF LEN(a$) = 3 AND VAL(a$) < 0 THEN
  345.             a$ = "-0." + RIGHT$(a$, 2)
  346.         ELSE
  347.             a$ = LEFT$(a$, LEN(a$) - 2) + "." + RIGHT$(a$, 2)
  348.         END IF
  349.     ELSE
  350.         a$ = "0.00"
  351.     END IF
  352.     a = b - LEN(a$)
  353.     IF a > 0 THEN
  354.         a$ = SPACE$(a) + a$
  355.     END IF
  356.     IF LEN(a$) - 6 > 0 THEN
  357.         IF MID$(a$, LEN(a$) - 6, 1) <> " " AND MID$(a$, LEN(a$) - 6, 1) <> "-" THEN
  358.             a$ = LEFT$(a$, LEN(a$) - 6) + "," + MID$(a$, LEN(a$) - 5)
  359.             a$ = MID$(a$, 2): '--para quitar caracter que se ha generado por meter la coma
  360.         END IF
  361.     END IF
  362.     IF LEN(a$) - 10 > 0 THEN
  363.         IF MID$(a$, LEN(a$) - 10, 1) <> " " AND MID$(a$, LEN(a$) - 10, 1) <> "-" THEN
  364.             a$ = LEFT$(a$, LEN(a$) - 10) + "," + MID$(a$, LEN(a$) - 9)
  365.             a$ = MID$(a$, 2): '--para quitar caracter que se ha generado por meter la coma
  366.         END IF
  367.     END IF
  368.     IF LEN(a$) - 14 > 0 THEN
  369.         IF MID$(a$, LEN(a$) - 14, 1) <> " " AND MID$(a$, LEN(a$) - 14, 1) <> "-" THEN
  370.             a$ = LEFT$(a$, LEN(a$) - 14) + "," + MID$(a$, LEN(a$) - 13)
  371.             a$ = MID$(a$, 2): '--para quitar caracter que se ha generado por meter la coma
  372.         END IF
  373.     END IF
  374.  
  375. SUB converprin3 (a$, b)
  376.     '----------------------------------------- CONVERTIR NUMERO CON SEPARADORES DE MILES  Y 3 DECIMALES -----------------------
  377.     IF VAL(a$) <> 0 THEN
  378.         c# = VAL(a$)
  379.         d# = c# * 1000 + .5
  380.         a# = INT(d#)
  381.         a$ = LTRIM$(STR$(a#))
  382.         IF LEN(a$) = 1 THEN
  383.             a$ = "0.00" + a$
  384.         ELSEIF LEN(a$) = 2 THEN
  385.             IF VAL(a$) < 0 THEN
  386.                 a$ = "-0.00" + RIGHT$(a$, 1)
  387.             ELSE
  388.                 a$ = "0.0" + a$
  389.             END IF
  390.         ELSEIF LEN(a$) = 3 THEN
  391.             IF VAL(a$) < 0 THEN
  392.                 a$ = "-0.0" + RIGHT$(a$, 2)
  393.             ELSE
  394.                 a$ = "0." + RIGHT$(a$, 3)
  395.             END IF
  396.         ELSEIF LEN(a$) = 4 AND VAL(a$) < 0 THEN
  397.             a$ = "-0." + RIGHT$(a$, 3)
  398.         ELSE
  399.             a$ = LEFT$(a$, LEN(a$) - 3) + "." + RIGHT$(a$, 3)
  400.         END IF
  401.     ELSE
  402.         a$ = "0.000"
  403.     END IF
  404.     a = b - LEN(a$)
  405.     IF a > 0 THEN
  406.         a$ = SPACE$(a) + a$
  407.     END IF
  408.     IF LEN(a$) - 7 > 0 THEN
  409.         IF MID$(a$, LEN(a$) - 7, 1) <> " " AND MID$(a$, LEN(a$) - 7, 1) <> "-" THEN
  410.             a$ = LEFT$(a$, LEN(a$) - 7) + "," + MID$(a$, LEN(a$) - 6)
  411.             a$ = MID$(a$, 2): '--para quitar caracter que se ha generado por meter la coma
  412.         END IF
  413.     END IF
  414.     IF LEN(a$) - 11 > 0 THEN
  415.         IF MID$(a$, LEN(a$) - 11, 1) <> " " AND MID$(a$, LEN(a$) - 11, 1) <> "-" THEN
  416.             a$ = LEFT$(a$, LEN(a$) - 11) + "," + MID$(a$, LEN(a$) - 10)
  417.             a$ = MID$(a$, 2): '--para quitar caracter que se ha generado por meter la coma
  418.         END IF
  419.     END IF
  420.     IF LEN(a$) - 15 > 0 THEN
  421.         IF MID$(a$, LEN(a$) - 15, 1) <> " " AND MID$(a$, LEN(a$) - 15, 1) <> "-" THEN
  422.             a$ = LEFT$(a$, LEN(a$) - 15) + "," + MID$(a$, LEN(a$) - 14)
  423.             a$ = MID$(a$, 2): '--para quitar caracter que se ha generado por meter la coma
  424.         END IF
  425.     END IF
  426.  
  427. SUB converprinentero (a$, b)
  428.     '----------------------------------------- CONVERTIR NUMERO ENTERO CON SEPARADORES DE MILES -----------------------
  429.     a = b - LEN(a$)
  430.     IF a > 0 THEN
  431.         a$ = SPACE$(a) + a$
  432.     END IF
  433.     IF LEN(a$) - 3 > 0 THEN
  434.         IF MID$(a$, LEN(a$) - 3, 1) <> " " AND MID$(a$, LEN(a$) - 3, 1) <> "-" THEN
  435.             a$ = LEFT$(a$, LEN(a$) - 3) + "," + MID$(a$, LEN(a$) - 2)
  436.             a$ = MID$(a$, 2): '--para quitar caracter que se ha generado por meter la coma
  437.         END IF
  438.     END IF
  439.     IF LEN(a$) - 7 > 0 THEN
  440.         IF MID$(a$, LEN(a$) - 7, 1) <> " " AND MID$(a$, LEN(a$) - 7, 1) <> "-" THEN
  441.             a$ = LEFT$(a$, LEN(a$) - 7) + "," + MID$(a$, LEN(a$) - 6)
  442.             a$ = MID$(a$, 2): '--para quitar caracter que se ha generado por meter la coma
  443.         END IF
  444.     END IF
  445.     IF LEN(a$) - 11 > 0 THEN
  446.         IF MID$(a$, LEN(a$) - 11, 1) <> " " AND MID$(a$, LEN(a$) - 11, 1) <> "-" THEN
  447.             a$ = LEFT$(a$, LEN(a$) - 11) + "," + MID$(a$, LEN(a$) - 10)
  448.             a$ = MID$(a$, 2): '--para quitar caracter que se ha generado por meter la coma
  449.         END IF
  450.     END IF
  451.  
  452. SUB nonum (a$, bien)
  453.     '------------------------ COMPROBAR SI ES UN NUMERO --------------------------
  454.     FOR c = 1 TO LEN(a$)
  455.         IF ASC(MID$(a$, c)) < 45 OR ASC(MID$(a$, c)) > 57 THEN
  456.             bien = 0: a$ = "": EXIT SUB
  457.         END IF
  458.     NEXT c
  459.     z = INSTR(a$, "-")
  460.     IF z <> 0 AND z <> 1 THEN bien = 0: a$ = "": EXIT SUB
  461.     IF z = 1 THEN
  462.         z = INSTR(2, a$, "-")
  463.         IF z <> 0 THEN a$ = "": bien = 0: EXIT SUB
  464.     END IF
  465.     z = INSTR(a$, ".")
  466.     IF z <> 0 THEN
  467.         z = INSTR(z + 1, a$, ".")
  468.         IF z <> 0 THEN a$ = "": bien = 0: EXIT SUB
  469.     END IF
  470.     bien = 1: EXIT SUB
  471.  
  472.  
  473. SUB rutimput (y, x, a$, l, ant, sp, nu$)
  474.     '----------------------- ENTRADA DE DATOS DESDE TECLADO ---------------------
  475.     ant = 0: c = LEN(a$): control = 0: LOCATE y, x: PRINT SPC(sp);
  476.     DO
  477.         IF INSTR(nu$, "F") THEN
  478.             LOCATE y, x: PRINT "../../..";
  479.             LOCATE y, x
  480.             FOR longi = 1 TO LEN(a$)
  481.                 IF longi = 3 OR longi = 5 THEN PRINT "/";
  482.                 PRINT MID$(a$, longi, 1);
  483.             NEXT
  484.         ELSE
  485.             LOCATE y, x: PRINT STRING$(l, ".");: LOCATE y, x: PRINT a$;
  486.         END IF
  487.         x$ = ""
  488.         WHILE x$ = ""
  489.             IF INSTR(nu$, "F") THEN
  490.                 IF c = 2 OR c = 3 THEN
  491.                     LOCATE y, x + c + 1, 1
  492.                 END IF
  493.                 IF c = 4 OR c = 5 THEN
  494.                     LOCATE y, x + c + 2, 1
  495.                 END IF
  496.                 IF c = 1 OR c = 0 THEN
  497.                     LOCATE y, x + c, 1
  498.                 END IF
  499.             ELSE
  500.                 LOCATE y, x + c, 1
  501.             END IF
  502.             x$ = INKEY$
  503.         WEND
  504.        2 IF LEN(x$) = 1 THEN
  505.             SELECT CASE ASC(x$)
  506.                 CASE 13
  507.                     EXIT SUB
  508.                 CASE 8
  509.                     SELECT CASE c
  510.                         CASE 0
  511.                             '--BEEP
  512.                         CASE 1
  513.                             a$ = MID$(a$, 2, LEN(a$) - 1): c = c - 1
  514.                             LOCATE y, x: PRINT a$ + ".";
  515.                         CASE ELSE
  516.                             a$ = LEFT$(a$, c - 1) + MID$(a$, c + 1, LEN(a$) - c)
  517.                             c = c - 1: LOCATE y, x: PRINT a$ + ".";
  518.                     END SELECT
  519.                 CASE 27
  520.                     ant = 2: a$ = "": LOCATE y, x: PRINT SPC(sp);: EXIT SUB
  521.                 CASE ELSE
  522.                     IF INSTR(nu$, "T") = 0 AND INSTR("1234567890.-", x$) = 0 THEN
  523.                         '--BEEP
  524.                     ELSE
  525.                         IF INSTR(nu$, "E") AND x$ = "." THEN
  526.                             '--BEEP
  527.                         ELSE
  528.                             IF INSTR(nu$, "P") AND x$ = "-" THEN
  529.                                 '--BEEP
  530.                             ELSE
  531.                                 IF INSTR(nu$, "T") = 0 AND x$ = "-" AND c <> 0 THEN
  532.                                     '--BEEP
  533.                                 ELSE
  534.                                     IF INSTR(nu$, "T") = 0 AND x$ = "." AND INSTR(a$, ".") THEN
  535.                                         '--BEEP
  536.                                     ELSE
  537.                                         IF ASC(x$) = 241 THEN x$ = CHR$(164) 'para convertir la ¤
  538.                                         IF INSTR(nu$, "m") = 0 THEN
  539.                                             IF x$ = "¤" THEN x$ = "¥"
  540.                                             x$ = UCASE$(x$)
  541.                                         END IF
  542.                                         c = c + 1
  543.                                         IF c > l THEN
  544.                                             c = c - 1
  545.                                         ELSE
  546.                                             IF LEN(a$) = l AND control = 1 THEN
  547.                                                 c = c - 1
  548.                                             ELSE
  549.                                                 IF control = 0 THEN
  550.                                                     IF c = LEN(a$) + 1 THEN
  551.                                                         a$ = a$ + x$
  552.                                                     ELSE
  553.                                                         MID$(a$, c, 1) = x$
  554.                                                     END IF
  555.                                                 ELSE
  556.                                                     a$ = LEFT$(a$, c - 1) + x$ + RIGHT$(a$, LEN(a$) - c + 1)
  557.                                                 END IF
  558.                                                 IF INSTR(nu$, "F") THEN
  559.                                                     FOR longi = 1 TO LEN(a$)
  560.                                                         LOCATE y, x
  561.                                                         IF longi = 3 OR longi = 5 THEN PRINT "/";
  562.                                                         PRINT MID$(a$, longi, 1);
  563.                                                     NEXT
  564.                                                 ELSE
  565.                                                     LOCATE y, x: PRINT a$;
  566.                                                 END IF
  567.                                             END IF
  568.                                         END IF
  569.                                     END IF
  570.                                 END IF
  571.                             END IF
  572.                         END IF
  573.                     END IF
  574.             END SELECT
  575.         ELSE
  576.             z = ASC(RIGHT$(x$, 1))
  577.             SELECT CASE z
  578.                 CASE 59
  579.                     CALL calcu(a$)
  580.                     c = LEN(a$)
  581.                     CALL colpos(y, x, colo1, colo2)
  582.                     COLOR colo1, colo2
  583.  
  584.                 CASE 75
  585.                     control = 0
  586.                     IF c = 0 THEN
  587.                         '--BEEP
  588.                     ELSE
  589.                         c = c - 1
  590.                     END IF
  591.                 CASE 77
  592.                     control = 0
  593.                     IF c = LEN(a$) THEN
  594.                         '--BEEP
  595.                     ELSE
  596.                         c = c + 1
  597.                     END IF
  598.                 CASE 72
  599.                     ant = 1: a$ = "": LOCATE y, x: PRINT SPC(sp);: EXIT SUB
  600.                 CASE 80
  601.                     ant = z: a$ = "": LOCATE y, x: PRINT SPC(sp);: EXIT SUB
  602.                 CASE 82
  603.                     IF control = 0 AND c <> LEN(a$) THEN
  604.                         control = 1
  605.                     ELSE
  606.                         control = 0
  607.                     END IF
  608.                 CASE 83
  609.                     a$ = "": c = 0
  610.                 CASE 59 TO 68
  611.                     ant = z: a$ = "": LOCATE y, x: PRINT SPC(sp);: EXIT SUB
  612.                 CASE 121
  613.                     '--para evitar error de teclado con la arroba
  614.                     x$ = CHR$(64): GOTO 2
  615.                 CASE ELSE
  616.                     '--BEEP
  617.             END SELECT
  618.         END IF
  619.     LOOP
  620.     IF INSTR(nu$, "m") = 0 THEN
  621.         a$ = UCASE$(a$)
  622.     END IF
  623.  
  624. SUB buscacli2 (a$)
  625.     '------------------------- BUSCAR CLIENTE POR NOMBRE ----------------------------
  626.     PCOPY 0, 2
  627.     REDIM DB_RESULT(columns, rows) AS STRING
  628.     COLOR 7, 1
  629.     LOCATE 25, 1: PRINT SPACE$(80);
  630.     COLOR 1, 7
  631.     bus = 2
  632.     LOCATE 4, 10: PRINT " ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍ Busqueda de Clientes Por Apodo    ÍÍÍÍÍÍÍÍÍÍÍÍÍÍ» "
  633.     LOCATE 5, 10: PRINT " º                                                               º "
  634.     LOCATE 6, 10: PRINT " º                                                               º "
  635.     LOCATE 7, 10: PRINT " º                                                               º "
  636.     LOCATE 8, 10: PRINT " º                                                               º "
  637.     LOCATE 9, 10: PRINT " º                    *Texto=Busqueda generica                   º "
  638.     LOCATE 10, 10: PRINT " ÈÍÍÍÍÍÍÍÍÍÍÍ <F4> Cambiar busqueda ÍÍÍÍÍÍÍÍÍÍ <Esc> ÍÍÍÍÍÍÍÍÍÍÍͼ "
  639.     DO
  640.         si = 0
  641.         IF bus = 1 THEN
  642.             y = 7: x = 13: a$ = "": l = 40: sp = 40: nu$ = "T"
  643.         ELSE
  644.             y = 7: x = 13: a$ = "": l = 15: sp = 40: nu$ = "T"
  645.         END IF
  646.         CALL rutimput(y, x, a$, l, ant, sp, nu$)
  647.         IF ant = 2 THEN a$ = "@": fin = 1: EXIT DO
  648.         IF ant = 62 THEN
  649.             IF bus = 1 THEN
  650.                 bus = 2
  651.                 LOCATE 4, 10: PRINT " ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍ Busqueda de Clientes Por Apodo    ÍÍÍÍÍÍÍÍÍÍÍÍÍÍ» "
  652.             ELSE
  653.                 IF bus = 2 THEN
  654.                     bus = 1
  655.                     LOCATE 4, 10: PRINT " ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍ Busqueda de Clientes Por Apellido ÍÍÍÍÍÍÍÍÍÍÍÍÍÍ» "
  656.                 END IF
  657.             END IF
  658.         END IF
  659.         IF a$ <> "" THEN
  660.             IF LEFT$(a$, 1) <> "*" THEN
  661.                 '--busqueda por iniciales
  662.                 IF bus = 1 THEN
  663.                     busclave$ = "SELECT apodo, nombre, codigo FROM cliente WHERE nombre LIKE '" + a$ + "%'" + CHR$(0)
  664.                 ELSE
  665.                     busclave$ = "SELECT apodo, nombre, codigo FROM cliente WHERE apodo LIKE '" + a$ + "%'" + CHR$(0)
  666.                 END IF
  667.                 CALL basedato(busclave$, rows, columns)
  668.                 IF rows <> 0 THEN
  669.                     LOCATE 10, 10: PRINT " ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ<" + CHR$(24) + ">ÍÍÍÍÍÍÍÍÍ<" + CHR$(25) + ">ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ "
  670.                     COLOR 0, 7
  671.                     EXIT DO
  672.                 END IF
  673.             ELSE
  674.                 IF LEN(a$) = 1 THEN
  675.                     '--busqueda de todos los datos
  676.                     IF bus = 1 THEN
  677.                         busclave$ = "SELECT apodo, nombre, codigo FROM cliente ORDER BY nombre" + CHR$(0)
  678.                     ELSE
  679.                         busclave$ = "SELECT apodo, nombre, codigo FROM cliente ORDER BY apodo" + CHR$(0)
  680.                     END IF
  681.                     CALL basedato(busclave$, rows, columns)
  682.                     IF rows <> 0 THEN
  683.                         LOCATE 10, 10: PRINT " ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ<" + CHR$(24) + ">ÍÍÍÍÍÍÍÍÍ<" + CHR$(25) + ">ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ "
  684.                         COLOR 0, 7
  685.                         EXIT DO
  686.                     END IF
  687.                 ELSE
  688.                     '--busqueda que contenga frase
  689.                     a$ = MID$(a$, 2)
  690.                     IF bus = 1 THEN
  691.                         busclave$ = "SELECT apodo, nombre, codigo FROM cliente WHERE nombre LIKE '%" + a$ + "%' ORDER BY nombre" + CHR$(0)
  692.                     ELSE
  693.                         busclave$ = "SELECT apodo, nombre, codigo FROM cliente WHERE apodo LIKE '%" + a$ + "%' ORDER BY apodo" + CHR$(0)
  694.                     END IF
  695.                     CALL basedato(busclave$, rows, columns)
  696.                     IF rows <> 0 THEN
  697.                         LOCATE 10, 10: PRINT " ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ<" + CHR$(24) + ">ÍÍÍÍÍÍÍÍÍ<" + CHR$(25) + ">ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ "
  698.                         COLOR 0, 7
  699.                         EXIT DO
  700.                     END IF
  701.                 END IF
  702.             END IF
  703.         END IF
  704.     LOOP
  705.     max = rows: loca = 1
  706.     GOSUB impridatos
  707.     DO
  708.         x$ = "": WHILE x$ = "": x$ = INKEY$: WEND
  709.         x$ = UCASE$(x$)
  710.         x = ASC(RIGHT$(x$, 1))
  711.         SELECT CASE x
  712.             CASE IS = 27
  713.                 a$ = "@"
  714.                 GOTO salbuspais
  715.             CASE IS = 13
  716.                 a$ = DB_RESULT(3, loca)
  717.                 GOTO salbuspais
  718.             CASE IS = 72: '--Subir
  719.                 IF loca > 1 THEN
  720.                     loca = loca - 1
  721.                     GOSUB impridatos
  722.                 END IF
  723.             CASE IS = 80: '--Bajar
  724.                 IF loca < max THEN
  725.                     loca = loca + 1
  726.                     GOSUB impridatos
  727.                 END IF
  728.         END SELECT
  729.     LOOP
  730.     COLOR 15, 0
  731.     GOTO salbuspais
  732.  
  733.     impridatos:
  734.     y = 1
  735.     FOR n = loca - 2 TO loca + 2
  736.         IF n < 1 OR n > max THEN
  737.             COLOR 1, 7
  738.             LOCATE y + 4, 10: PRINT " º                                                               º "
  739.             COLOR 15, 0
  740.             LOCATE y + 4, 12: PRINT "                                                               "
  741.         ELSE
  742.             IF n = loca THEN
  743.                 COLOR 1, 7
  744.             ELSE
  745.                 COLOR 7, 0
  746.             END IF
  747.             LOCATE y + 4, 12: PRINT "                                                               "
  748.             LOCATE y + 4, 13: PRINT LEFT$(DB_RESULT(1, n), 15)
  749.             LOCATE y + 4, 29: PRINT LEFT$(DB_RESULT(2, n), 40)
  750.             LOCATE y + 4, 70: PRINT LEFT$(DB_RESULT(3, n), 4)
  751.         END IF
  752.         y = y + 1
  753.     NEXT
  754.     RETURN
  755.  
  756.     salbuspais:
  757.     '-salir
  758.     PCOPY 2, 0
  759.     COLOR 15, 0
  760.  
  761.  
  762. SUB buscapro (a$)
  763.     '------------------------- BUSCAR POR NOMBRE PROVEEDORES ----------------------------
  764.     PCOPY 0, 2
  765.     REDIM DB_RESULT(columns, rows) AS STRING
  766.     COLOR 7, 1
  767.     LOCATE 25, 1: PRINT SPACE$(80);
  768.     COLOR 1, 7
  769.     bus = 2
  770.     LOCATE 4, 14: PRINT " ÉÍÍÍÍÍÍÍÍÍÍ Busqueda de Proveedores por Apodo     ÍÍÍÍÍÍÍÍÍ» "
  771.     LOCATE 5, 14: PRINT " º                                                          º "
  772.     LOCATE 6, 14: PRINT " º                                                          º "
  773.     LOCATE 7, 14: PRINT " º                                                          º "
  774.     LOCATE 8, 14: PRINT " º                                                          º "
  775.     LOCATE 9, 14: PRINT " º                 *Texto=Busqueda generica                 º "
  776.     LOCATE 10, 14: PRINT " ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ<Esc>ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ "
  777.     DO
  778.         si = 0
  779.         IF bus = 1 THEN
  780.             y = 7: x = 17: a$ = "": l = 40: sp = 40: nu$ = "T"
  781.         ELSE
  782.             y = 7: x = 17: a$ = "": l = 10: sp = 40: nu$ = "T"
  783.         END IF
  784.         CALL rutimput(y, x, a$, l, ant, sp, nu$)
  785.         IF ant = 2 THEN a$ = "@": fin = 1: EXIT DO
  786.         IF ant = 62 THEN
  787.             IF bus = 1 THEN
  788.                 bus = 2
  789.                 LOCATE 4, 14: PRINT " ÉÍÍÍÍÍÍÍÍÍÍ Busqueda de Proveedores por Apodo     ÍÍÍÍÍÍÍÍÍ» "
  790.             ELSE
  791.                 IF bus = 2 THEN
  792.                     bus = 1
  793.                     LOCATE 4, 14: PRINT " ÉÍÍÍÍÍÍÍÍÍÍ Busqueda de Proveedores por Apellido  ÍÍÍÍÍÍÍÍÍ» "
  794.                 END IF
  795.             END IF
  796.         END IF
  797.         IF a$ <> "" THEN
  798.             IF LEFT$(a$, 1) <> "*" THEN
  799.                 '--busqueda por iniciales
  800.                 IF bus = 1 THEN
  801.                     busclave$ = "SELECT apodo, nombre, codigo FROM proveedor WHERE nombre LIKE '" + a$ + "%'" + CHR$(0)
  802.                 ELSE
  803.                     busclave$ = "SELECT apodo, nombre, codigo FROM proveedor WHERE apodo LIKE '" + a$ + "%'" + CHR$(0)
  804.                 END IF
  805.                 CALL basedato(busclave$, rows, columns)
  806.                 IF rows <> 0 THEN
  807.                     LOCATE 10, 14: PRINT " ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ<"; CHR$(24); ">ÍÍÍÍÍÍÍÍÍÍ<"; CHR$(25); ">ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ "
  808.                     COLOR 0, 7
  809.                     EXIT DO
  810.                 END IF
  811.             ELSE
  812.                 IF LEN(a$) = 1 THEN
  813.                     '--busqueda de todos los datos
  814.                     IF bus = 1 THEN
  815.                         busclave$ = "SELECT apodo, nombre, codigo FROM proveedor ORDER BY nombre" + CHR$(0)
  816.                     ELSE
  817.                         busclave$ = "SELECT apodo, nombre, codigo FROM proveedor ORDER BY apodo" + CHR$(0)
  818.                     END IF
  819.                     CALL basedato(busclave$, rows, columns)
  820.                     IF rows <> 0 THEN
  821.                         LOCATE 10, 14: PRINT " ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ<"; CHR$(24); ">ÍÍÍÍÍÍÍÍÍÍ<"; CHR$(25); ">ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ "
  822.                         COLOR 0, 7
  823.                         EXIT DO
  824.                     END IF
  825.                 ELSE
  826.                     '--busqueda que contenga frase
  827.                     a$ = MID$(a$, 2)
  828.                     IF bus = 1 THEN
  829.                         busclave$ = "SELECT apodo, nombre, codigo FROM proveedor WHERE nombre LIKE '%" + a$ + "%' ORDER BY nombre" + CHR$(0)
  830.                     ELSE
  831.                         busclave$ = "SELECT apodo, nombre, codigo FROM proveedor WHERE apodo LIKE '%" + a$ + "%' ORDER BY apodo" + CHR$(0)
  832.                     END IF
  833.                     CALL basedato(busclave$, rows, columns)
  834.                     IF rows <> 0 THEN
  835.                         LOCATE 10, 14: PRINT " ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ<"; CHR$(24); ">ÍÍÍÍÍÍÍÍÍÍ<"; CHR$(25); ">ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ "
  836.                         COLOR 0, 7
  837.                         EXIT DO
  838.                     END IF
  839.                 END IF
  840.             END IF
  841.         END IF
  842.     LOOP
  843.     max = rows: loca = 1
  844.     GOSUB impridatos
  845.     DO
  846.         x$ = "": WHILE x$ = "": x$ = INKEY$: WEND
  847.         x$ = UCASE$(x$)
  848.         x = ASC(RIGHT$(x$, 1))
  849.         SELECT CASE x
  850.             CASE IS = 27
  851.                 a$ = "@"
  852.                 GOTO salbuspais
  853.             CASE IS = 13
  854.                 a$ = DB_RESULT(3, loca)
  855.                 GOTO salbuspais
  856.             CASE IS = 72: '--Subir
  857.                 IF loca > 1 THEN
  858.                     loca = loca - 1
  859.                     GOSUB impridatos
  860.                 END IF
  861.             CASE IS = 80: '--Bajar
  862.                 IF loca < max THEN
  863.                     loca = loca + 1
  864.                     GOSUB impridatos
  865.                 END IF
  866.         END SELECT
  867.     LOOP
  868.     COLOR 15, 0
  869.     GOTO salbuspais
  870.  
  871.     impridatos:
  872.     y = 1
  873.     FOR n = loca - 2 TO loca + 2
  874.         IF n < 1 OR n > max THEN
  875.             COLOR 1, 7
  876.             LOCATE y + 4, 14: PRINT " º                                                          º "
  877.             COLOR 15, 0
  878.             LOCATE y + 4, 17: PRINT "                                                        "
  879.         ELSE
  880.             IF n = loca THEN
  881.                 COLOR 1, 7
  882.             ELSE
  883.                 COLOR 7, 0
  884.             END IF
  885.             LOCATE y + 4, 17: PRINT "                                                        "
  886.             LOCATE y + 4, 17: PRINT LEFT$(DB_RESULT(1, n), 10)
  887.             LOCATE y + 4, 28: PRINT LEFT$(DB_RESULT(2, n), 40)
  888.             LOCATE y + 4, 69: PRINT LEFT$(DB_RESULT(3, n), 4)
  889.         END IF
  890.         y = y + 1
  891.     NEXT
  892.     RETURN
  893.  
  894.     salbuspais:
  895.     '-salir
  896.     PCOPY 2, 0
  897.     COLOR 15, 0
  898.  
  899. SUB consuart (a$)
  900.     '------------------------- BUSCAR POR NOMBRE ARTICULO ----------------------------
  901.     PCOPY 0, 2
  902.     REDIM DB_RESULT(columns, rows) AS STRING
  903.     COLOR 7, 1
  904.     LOCATE 25, 1: PRINT SPACE$(80);
  905.     COLOR 1, 7
  906.     LOCATE 4, 14: PRINT " ÉÍÍ Busqueda de Articulos ÍÍ» "
  907.     LOCATE 5, 14: PRINT " º                           º "
  908.     LOCATE 6, 14: PRINT " º                           º "
  909.     LOCATE 7, 14: PRINT " º                           º "
  910.     LOCATE 8, 14: PRINT " º                           º "
  911.     LOCATE 9, 14: PRINT " º *Texto=Busqueda generica  º "
  912.     LOCATE 10, 14: PRINT " ÈÍÍÍÍÍÍÍÍÍÍÍ<Esc>ÍÍÍÍÍÍÍÍÍÍͼ "
  913.     DO
  914.         si = 0
  915.         y = 7: x = 17: a$ = "": l = 20: sp = 20: nu$ = "T"
  916.         CALL rutimput(y, x, a$, l, ant, sp, nu$)
  917.         IF ant = 2 THEN a$ = "@": fin = 1: EXIT DO
  918.         IF a$ <> "" THEN
  919.             IF LEFT$(a$, 1) <> "*" THEN
  920.                 '--busqueda por iniciales
  921.                 busclave$ = "SELECT nombre, codigo FROM articulo WHERE nombre LIKE '" + a$ + "%'" + CHR$(0)
  922.                 CALL basedato(busclave$, rows, columns)
  923.                 IF rows = 0 THEN
  924.                     '--BEEP
  925.                 ELSE
  926.                     LOCATE 10, 20: PRINT "<"; CHR$(24); ">ÍÍ<"; CHR$(25); ">"
  927.                     COLOR 0, 7
  928.                     EXIT DO
  929.                 END IF
  930.             ELSE
  931.                 IF LEN(a$) = 1 THEN
  932.                     '--busqueda de todos los datos
  933.                     busclave$ = "SELECT nombre, codigo FROM articulo" + CHR$(0)
  934.                     CALL basedato(busclave$, rows, columns)
  935.                     IF rows = 0 THEN
  936.                         '--BEEP
  937.                     ELSE
  938.                         LOCATE 10, 20: PRINT "<"; CHR$(24); ">ÍÍ<"; CHR$(25); ">"
  939.                         COLOR 0, 7
  940.                         EXIT DO
  941.                     END IF
  942.                 ELSE
  943.                     '--busqueda que contenga frase
  944.                     IF LEN(a$) > 1 THEN
  945.                         a$ = MID$(a$, 2)
  946.                         busclave$ = "SELECT nombre, codigo FROM articulo WHERE nombre LIKE '%" + a$ + "%'" + CHR$(0)
  947.                         CALL basedato(busclave$, rows, columns)
  948.                         IF rows <> 0 THEN
  949.                             LOCATE 10, 20: PRINT "<"; CHR$(24); ">ÍÍ<"; CHR$(25); ">"
  950.                             COLOR 0, 7
  951.                             EXIT DO
  952.                         END IF
  953.                     END IF
  954.                 END IF
  955.             END IF
  956.         END IF
  957.     LOOP
  958.     max = rows: loca = 1
  959.     GOSUB impridatos
  960.     DO
  961.         x$ = "": WHILE x$ = "": x$ = INKEY$: WEND
  962.         x$ = UCASE$(x$)
  963.         x = ASC(RIGHT$(x$, 1))
  964.         SELECT CASE x
  965.             CASE IS = 27
  966.                 a$ = "@"
  967.                 GOTO salbuspais
  968.             CASE IS = 13
  969.                 a$ = DB_RESULT(2, loca)
  970.                 GOTO salbuspais
  971.             CASE IS = 72: '--Subir
  972.                 IF loca > 1 THEN
  973.                     loca = loca - 1
  974.                     GOSUB impridatos
  975.                 END IF
  976.             CASE IS = 80: '--Bajar
  977.                 IF loca < max THEN
  978.                     loca = loca + 1
  979.                     GOSUB impridatos
  980.                 END IF
  981.         END SELECT
  982.     LOOP
  983.     COLOR 15, 0
  984.     GOTO salbuspais
  985.  
  986.     impridatos:
  987.     y = 1
  988.     FOR n = loca - 2 TO loca + 2
  989.         IF n < 1 OR n > max THEN
  990.             COLOR 1, 7
  991.             LOCATE y + 4, 14: PRINT " º                           º "
  992.             COLOR 15, 0
  993.             LOCATE y + 4, 17: PRINT "                          "
  994.         ELSE
  995.             IF n = loca THEN
  996.                 COLOR 1, 7
  997.             ELSE
  998.                 COLOR 7, 0
  999.             END IF
  1000.             LOCATE y + 4, 17: PRINT "                          "
  1001.             LOCATE y + 4, 17: PRINT DB_RESULT(1, n)
  1002.             LOCATE y + 4, 40: PRINT DB_RESULT(2, n)
  1003.         END IF
  1004.         y = y + 1
  1005.     NEXT
  1006.     RETURN
  1007.  
  1008.     salbuspais:
  1009.     '-salir
  1010.     PCOPY 2, 0
  1011.     COLOR 15, 0
  1012.  
  1013. SUB predeter (impresora$)
  1014.     mimpresora$ = ""
  1015.     PCOPY 0, 3
  1016.     COLOR 15, 0
  1017.     SHELL _HIDE "cmd/c wmic printer get name, default> impresora.txt"
  1018.     DIM impresora(50) AS STRING
  1019.     OPEN "I", 10, "impresora.txt"
  1020.     n% = 0
  1021.     LINE INPUT #10, dato$
  1022.     DO
  1023.         LINE INPUT #10, dato$: LINE INPUT #10, dato$
  1024.         IF EOF(10) THEN EXIT DO
  1025.         n% = n% + 1
  1026.         DO
  1027.             a% = INSTR(dato$, CHR$(0))
  1028.             IF a% = 0 THEN EXIT DO
  1029.             IF a% = 1 THEN
  1030.                 dato$ = MID$(dato$, a% + 1)
  1031.             ELSEIF a% = LEN(dato$) THEN
  1032.                 dato$ = LEFT$(dato$, a% - 1)
  1033.             ELSE
  1034.                 dato$ = LEFT$(dato$, a% - 1) + MID$(dato$, a% + 1)
  1035.             END IF
  1036.         LOOP
  1037.         a% = INSTR(dato$, "FALSE"): b% = INSTR(dato$, "TRUE")
  1038.         IF a% <> 0 THEN
  1039.             MID$(dato$, a%, 5) = SPACE$(5)
  1040.             dato$ = LTRIM$(RTRIM$(dato$))
  1041.         END IF
  1042.         IF b% <> 0 THEN
  1043.             MID$(dato$, b%, 5) = SPACE$(4)
  1044.             dato$ = LTRIM$(RTRIM$(dato$))
  1045.             loca% = n%
  1046.             IF impresora$ = "" THEN mimpresora$ = dato$
  1047.         END IF
  1048.         impresora(n%) = dato$
  1049.         impresora(0) = LTRIM$(STR$(n%))
  1050.     LOOP
  1051.     CLOSE 10
  1052.     COLOR 1, 7
  1053.     LOCATE 8, 20: PRINT "ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»"
  1054.     LOCATE 9, 20: PRINT "º                                        º"
  1055.     LOCATE 10, 20: PRINT "ÌÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ͹"
  1056.     LOCATE 11, 20: PRINT "º                                        º"
  1057.     LOCATE 12, 20: PRINT "º                                        º"
  1058.     LOCATE 13, 20: PRINT "º                                        º"
  1059.     LOCATE 14, 20: PRINT "º                                        º"
  1060.     LOCATE 15, 20: PRINT "º                                        º"
  1061.     LOCATE 16, 20: PRINT "ÈÍÍÍÍÍÍÍ<Esc>ÍÍÍÍ<"; CHR$(24); ">Í<"; CHR$(25); ">ÍÍÍÍ<"; CHR$(17); CHR$(217); ">ÍÍÍÍÍÍÍÍͼ"
  1062.     COLOR 15, 1
  1063.     LOCATE 9, 21: PRINT "          SELECCIONAR IMPRESORA         ";
  1064.     COLOR 1, 7
  1065.     max% = VAL(impresora(0))
  1066.     GOSUB impridatos
  1067.     DO
  1068.         x$ = "": WHILE x$ = "": x$ = INKEY$: WEND
  1069.         x$ = UCASE$(x$)
  1070.         x% = ASC(RIGHT$(x$, 1))
  1071.         SELECT CASE x%
  1072.             CASE IS = 27
  1073.                 a$ = "@"
  1074.                 EXIT DO
  1075.             CASE IS = 13
  1076.                 a$ = impresora(loca%)
  1077.                 EXIT DO
  1078.             CASE IS = 72: '--Subir
  1079.                 IF loca% > 1 THEN
  1080.                     loca% = loca% - 1
  1081.                     GOSUB impridatos
  1082.                 END IF
  1083.             CASE IS = 80: '--Bajar
  1084.                 IF loca% < max% THEN
  1085.                     loca% = loca% + 1
  1086.                     GOSUB impridatos
  1087.                 END IF
  1088.         END SELECT
  1089.     LOOP
  1090.     IF a$ <> "@" THEN
  1091.         SHELL _HIDE "cmd/c wmic printer where name='" + a$ + "' call setdefaultprinter"
  1092.         LOCATE 20, 20: PRINT "Impresora seleccionada: "; a$: SLEEP 3
  1093.         IF a$ <> mimpresora$ THEN
  1094.             IF impresora$ = "" THEN impresora$ = mimpresora$
  1095.         END IF
  1096.     ELSE
  1097.         LOCATE 20, 20: PRINT "No se ha modificado la impresora": SLEEP 3
  1098.     END IF
  1099.     KILL "impresora.txt"
  1100.     COLOR 15, 0
  1101.     PCOPY 3, 0
  1102.     EXIT SUB
  1103.  
  1104.     impridatos:
  1105.     y% = 1
  1106.     FOR n% = loca% - 2 TO loca% + 2
  1107.         IF n% < 1 OR n% > max% THEN
  1108.             COLOR 1, 7: LOCATE y% + 10, 21: PRINT "                                        "
  1109.         ELSE
  1110.             IF n% = loca% THEN COLOR 15, 4 ELSE COLOR 1, 7
  1111.             LOCATE y% + 10, 21: PRINT "                                        "
  1112.             LOCATE y% + 10, 21: PRINT LEFT$(impresora(n%), 40)
  1113.         END IF
  1114.         y% = y% + 1
  1115.     NEXT
  1116.     RETURN
  1117.  
  1118. SUB buspais (a$)
  1119.     '------------------------- BUSCAR POR PAIS ----------------------------
  1120.     PCOPY 0, 2
  1121.     max = 29
  1122.     DIM venta$(max)
  1123.     venta$(1) = "ESPA¥A         ES"
  1124.     venta$(2) = "ESPA¥A(CANAR.) E-"
  1125.     venta$(3) = "ALEMANIA       DE"
  1126.     venta$(4) = "AUSTRIA        AT"
  1127.     venta$(5) = "BELGICA        BE"
  1128.     venta$(6) = "BULGARIA       BG"
  1129.     venta$(7) = "CHIPRE         CY"
  1130.     venta$(8) = "CHEQUIA        CZ"
  1131.     venta$(9) = "DINAMARCA      DK"
  1132.     venta$(10) = "ESLOVENIA      SI"
  1133.     venta$(11) = "ESLOVAQUIA     SK"
  1134.     venta$(12) = "ESTONIA        EE"
  1135.     venta$(13) = "FINLANDIA      FI"
  1136.     venta$(14) = "FRANCIA        FR"
  1137.     venta$(15) = "GRECIA         EL"
  1138.     venta$(16) = "GRAN BRETA¥A   GB"
  1139.     venta$(17) = "HOLANDA        NL"
  1140.     venta$(18) = "HUNGRIA        HU"
  1141.     venta$(19) = "ITALIA         IT"
  1142.     venta$(20) = "IRLANDA        IE"
  1143.     venta$(21) = "LITUANIA       LT"
  1144.     venta$(22) = "LUXEMBURGO     LU"
  1145.     venta$(23) = "LETONIA        LV"
  1146.     venta$(24) = "MALTA          MT"
  1147.     venta$(25) = "MARRUECOS      MA"
  1148.     venta$(26) = "POLONIA        PL"
  1149.     venta$(27) = "PORTUGAL       PT"
  1150.     venta$(28) = "RUMANIA        RO"
  1151.     venta$(29) = "SUECIA         SE"
  1152.  
  1153.     COLOR 7, 1
  1154.     LOCATE 25, 1: PRINT SPACE$(80);
  1155.     COLOR 1, 7
  1156.     LOCATE 4, 25: PRINT " ÉÍÍ    Codigo de Paises   ÍÍ» "
  1157.     LOCATE 5, 25: PRINT " º                           º "
  1158.     LOCATE 6, 25: PRINT " º                           º "
  1159.     LOCATE 7, 25: PRINT " º                           º "
  1160.     LOCATE 8, 25: PRINT " º                           º "
  1161.     LOCATE 9, 25: PRINT " º                           º "
  1162.     LOCATE 10, 25: PRINT " ÈÍÍÍÍÍÍÍÍÍÍÍ<Esc>ÍÍÍÍÍÍÍÍÍÍͼ "
  1163.     LOCATE 10, 36: PRINT "<"; CHR$(24); ">ÍÍ<"; CHR$(25); ">"
  1164.     loca = 0
  1165.     FOR n = 1 TO max
  1166.         IF MID$(venta$(n), 16, 2) = a$ THEN loca = n: EXIT FOR
  1167.     NEXT
  1168.     IF loca = 0 THEN loca = 1
  1169.     GOSUB impridatos
  1170.     DO
  1171.         x$ = "": WHILE x$ = "": x$ = INKEY$: WEND
  1172.         x$ = UCASE$(x$)
  1173.         x = ASC(RIGHT$(x$, 1))
  1174.         SELECT CASE x
  1175.             CASE IS = 27
  1176.                 a$ = "@"
  1177.                 GOTO salbuspais
  1178.             CASE IS = 13
  1179.                 a$ = MID$(venta$(loca), 16, 2)
  1180.                 GOTO salbuspais
  1181.             CASE IS = 72: '--Subir
  1182.                 IF loca > 1 THEN
  1183.                     loca = loca - 1
  1184.                     GOSUB impridatos
  1185.                 END IF
  1186.             CASE IS = 80: '--Bajar
  1187.                 IF loca < max THEN
  1188.                     loca = loca + 1
  1189.                     GOSUB impridatos
  1190.                 END IF
  1191.         END SELECT
  1192.     LOOP
  1193.     COLOR 15, 0
  1194.     GOTO salbuspais
  1195.  
  1196.     impridatos:
  1197.     y = 1
  1198.     FOR n = loca - 2 TO loca + 2
  1199.         IF n < 1 OR n > max THEN
  1200.             COLOR 1, 7
  1201.             LOCATE y + 4, 25: PRINT " º                           º "
  1202.             COLOR 15, 0
  1203.             LOCATE y + 4, 27: PRINT "                           "
  1204.         ELSE
  1205.             IF n = loca THEN
  1206.                 COLOR 1, 7
  1207.             ELSE
  1208.                 COLOR 7, 0
  1209.             END IF
  1210.             LOCATE y + 4, 27: PRINT "  "; MID$(venta$(n), 1, 15); "     "
  1211.             LOCATE y + 4, 49: PRINT MID$(venta$(n), 16, 2); "   "
  1212.         END IF
  1213.         y = y + 1
  1214.     NEXT
  1215.     RETURN
  1216.  
  1217.  
  1218.     salbuspais:
  1219.     '-salir
  1220.     PCOPY 2, 0
  1221.     COLOR 15, 0
  1222.  

Also attached are the 32-bit mysql libraries

Offline Juanjogomez

  • Forum Regular
  • Posts: 117
    • View Profile
Re: Problem whith install in windows 10 Home
« Reply #12 on: June 08, 2020, 11:29:07 am »
I also attach the database

Offline luke

  • Administrator
  • Seasoned Forum Regular
  • Posts: 324
    • View Profile
Re: Problem whith install in windows 10 Home
« Reply #13 on: June 08, 2020, 12:32:44 pm »
In several places you call mysql_* functions without null-terminating your strings. This is potentially a problem.

Offline Juanjogomez

  • Forum Regular
  • Posts: 117
    • View Profile
Re: Problem whith install in windows 10 Home
« Reply #14 on: June 08, 2020, 12:43:36 pm »
Tanks for your time.
In what specific lines? And why does it work on some computers and not on others?