Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - ASJACO

Pages: [1]
1
QB64 Discussion / QB64 Practice
« on: November 02, 2019, 12:50:50 pm »
Hi i'm new using qb64 im trying to make some practices but i don't get at all some commands. I'm trying  to make a loop where i compare a business name(A2002$) with the user typing 5 characters (A$ = INPUT$(5)) from a file called COAN20 in that file is located all the business name but i'm not sure  which comand should i use. I would appreciate some help thanks. Here it is the code.

CLEAR
ON ERROR GOTO 930
'pelaja-> Check or modify clients by their business name.
'

DEFINT I-N
DEFLNG E
'Screen Position'
SCREEN 0, 0, 0

'Open COAN20 '
OPEN COMPA$ + "COAN20" FOR RANDOM SHARED AS 1 LEN = 778
FIELD 1, 2 AS N2097$
FIELD 1, 6 AS A2001$, 70 AS A2002$, 60 AS A2003$, 60 AS A2004$, 60 AS A2005$
FIELD 1, 256 AS A200$, 5 AS A2006$, 30 AS A2007$, 15 AS A2008$, 4 AS L2009$
FIELD 1, 310 AS A201$, 4 AS L2010$, 4 AS L2011$, 4 AS L2012$, 4 AS L2013$
FIELD 1, 326 AS A202$, 4 AS L2014$, 8 AS D2015$, 8 AS D2016$, 4 AS L2017$
FIELD 1, 350 AS A203$, 4 AS L2018$, 4 AS L2019$, 4 AS L2020$, 8 AS D2021$
FIELD 1, 370 AS A204$, 8 AS D2022$, 60 AS A2023$, 4 AS L2024$, 2 AS N2025$
FIELD 1, 444 AS A205$, 2 AS A2026$, 1 AS A2027$, 16 AS A2028$, 4 AS L2029$
FIELD 1, 467 AS A206$, 4 AS L2030$, 6 AS A2031$, 2 AS N2032$, 1 AS A2033$
FIELD 1, 480 AS A207$, 1 AS A2034$, 2 AS N2035$, 2 AS N2036$, 1 AS A2037$
FIELD 1, 486 AS A208$, 2 AS N2038$, 2 AS N2039$, 1 AS A2040$, 2 AS N2041$
FIELD 1, 493 AS A209$, 2 AS N2042$, 1 AS A2043$, 2 AS N2044$, 2 AS N2045$
FIELD 1, 500 AS A210$, 2 AS N2046$, 6 AS A2047$, 16 AS A2048$, 16 AS A2049$
FIELD 1, 540 AS A211$, 60 AS A2050$, 60 AS A2051$, 60 AS A2052$, 24 AS A2053$
FIELD 1, 744 AS A212$, 32 AS A2098$, 2 AS N2099$



GET 1,1 'Read file and archive
NUMR=CVI(N2097$) ' Register number
i = 2 ' Register value

10 Print "Please type 5 characters"
A$ = INPUT$(5) '5 characters type by the user
GET 1,i 'Reads file number and register value
if INSTR(A$, A2002$) THEN PRINT A2002$  'A2002$ is the business name
i = i + 1 'ITERation
ELSE GOTO 12


12 PRINT "Wanna make another search?"
INPUT "Y/N?"; DES$   
if UCASE$(DES$) = "Y" then GOTO 10 ELSE GOTO 1000
END
ELSE
GOTO 1000
'Desplegado del Error
930 IF ERR = 70 THEN RESUME
LOCATE 22, 22: PRINT "Error No.- "; ERR; " En la Linea.- "; ERL;
940 SOUND 37, 12
950 GOSUB 970: GOTO 1000

'Rutina con la Transmision.
970 A$ = "To continue press " + CHR$(34) + "any" + CHR$(34) + " keybind"
LOCATE 23, 20: COLOR 7, 1: PRINT A$;: COLOR 7, 0
A$ = INPUT$(1)
LOCATE 23, 1: PRINT SPACE$(79);
Hi i'm new using qb64 im trying to make some practices but i don't get at all some commands. I'm trying  to make a loop where i get all the business name from a file called COAN20 in that file is located all the business name but i'm not sure  which comand should i use. I would appreciate some help thanks. Here it is the code.

CLEAR
ON ERROR GOTO 930
'pelaja-> Check or modify clients by their business name.
'

DEFINT I-N
DEFLNG E
'Screen Position'
SCREEN 0, 0, 0

'Open COAN20 '
OPEN COMPA$ + "COAN20" FOR RANDOM SHARED AS 1 LEN = 778
FIELD 1, 2 AS N2097$
FIELD 1, 6 AS A2001$, 70 AS A2002$, 60 AS A2003$, 60 AS A2004$, 60 AS A2005$
FIELD 1, 256 AS A200$, 5 AS A2006$, 30 AS A2007$, 15 AS A2008$, 4 AS L2009$
FIELD 1, 310 AS A201$, 4 AS L2010$, 4 AS L2011$, 4 AS L2012$, 4 AS L2013$
FIELD 1, 326 AS A202$, 4 AS L2014$, 8 AS D2015$, 8 AS D2016$, 4 AS L2017$
FIELD 1, 350 AS A203$, 4 AS L2018$, 4 AS L2019$, 4 AS L2020$, 8 AS D2021$
FIELD 1, 370 AS A204$, 8 AS D2022$, 60 AS A2023$, 4 AS L2024$, 2 AS N2025$
FIELD 1, 444 AS A205$, 2 AS A2026$, 1 AS A2027$, 16 AS A2028$, 4 AS L2029$
FIELD 1, 467 AS A206$, 4 AS L2030$, 6 AS A2031$, 2 AS N2032$, 1 AS A2033$
FIELD 1, 480 AS A207$, 1 AS A2034$, 2 AS N2035$, 2 AS N2036$, 1 AS A2037$
FIELD 1, 486 AS A208$, 2 AS N2038$, 2 AS N2039$, 1 AS A2040$, 2 AS N2041$
FIELD 1, 493 AS A209$, 2 AS N2042$, 1 AS A2043$, 2 AS N2044$, 2 AS N2045$
FIELD 1, 500 AS A210$, 2 AS N2046$, 6 AS A2047$, 16 AS A2048$, 16 AS A2049$
FIELD 1, 540 AS A211$, 60 AS A2050$, 60 AS A2051$, 60 AS A2052$, 24 AS A2053$
FIELD 1, 744 AS A212$, 32 AS A2098$, 2 AS N2099$



GET 1, 2

PRINT A2002$
A$ = INPUT$(1)
GOTO 1000 'Manda a cerrar el sistema


'Desplegado del Error
930 IF ERR = 70 THEN RESUME
LOCATE 22, 22: PRINT "Error No.- "; ERR; " En la Linea.- "; ERL;
940 SOUND 37, 12
950 GOSUB 970: GOTO 1000

'Rutina con la Transmision.
970 A$ = "To continue press " + CHR$(34) + "any" + CHR$(34) + " keybind"
LOCATE 23, 20: COLOR 7, 1: PRINT A$;: COLOR 7, 0
A$ = INPUT$(1)
LOCATE 23, 1: PRINT SPACE$(79);
RETURN

Pages: [1]