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 - pinology

Pages: [1] 2
1
QB64 Discussion / Re: registry keys
« on: October 31, 2018, 08:14:34 pm »
umm I let that run for about 10mins didn't do anything and there is no file in the reg.  isn't there any way to have the program shell to the REG QUERY like I did from the command line and be able to assign a variable to the data I want which is the fe340dea without even creating another file ?  Have a happy Halloween and thanks again for the try!!

2
QB64 Discussion / Re: registry keys
« on: October 31, 2018, 07:40:51 pm »
ok thanks i'll give that a shot. do I have to export the temp.reg to the registry like that or could I call it temp.dat and export it right to my qb64 folder. if I have to put it in the registry I will but was kind of hoping I didn't.  thanks I appreciate the help!!!!

3
QB64 Discussion / Re: registry keys
« on: October 31, 2018, 05:22:58 pm »
How goes it mcneil,
tried a few different ways of using your lines to no avail
i'll show you what I get when I reg query from the command prompt and one of the ways I tried and hopefully you can tell me what I am doing wrong

from the command prompt
Microsoft Windows [Version 10.0.17134.285]
(c) 2018 Microsoft Corporation. All rights reserved.

C:\WINDOWS\system32>REG QUERY HKLM\Software\Dungeons /v data /t REG_BINARY

HKEY_LOCAL_MACHINE\Software\Dungeons
    data    REG_BINARY    FE340EAD

End of search: 1 match(es) found.

C:\WINDOWS\system32>

now it is that fe340ead that I want to be able to input into my program as a variable and work with it from there

one of the ways I tried

DIM dung AS STRING * 50
SHELL "REGEDIT /E \temp.REG " + CHR$(34) + "HKLM\Software\Dungeons /v data /t REG_BINARY" + CHR$(34)
OPEN "temp.reg" FOR INPUT AS #1
DO
    LINE INPUT #1, dung
LOOP UNTIL EOF(1)
CLOSE #1

4
QB64 Discussion / Re: registry keys
« on: October 26, 2018, 09:30:45 pm »
cool got it thanks!!!!

5
QB64 Discussion / Re: Variable-length strings in TYPEs
« on: October 26, 2018, 09:15:04 pm »
cool luke, that would come in real handy for putting data into random files and being able to access some of your variables numerically

6
QB64 Discussion / Re: registry keys
« on: October 26, 2018, 09:07:32 pm »
ok thanks i'll give that a shot.  i'm assuming I would have to use notepad and save those lines as a .bat file and have my qb program shell to it. regedit isn't a qb  function is  it?  Thanks for your help!!!

7
QB64 Discussion / Re: Variable-length strings in TYPEs
« on: October 26, 2018, 08:33:07 am »
kind of along the same lines I was wondering if you could use an array in a type variable something like
type a
  b(20) as integer
  c as string * 5
end type

8
QB64 Discussion / Re: registry keys
« on: October 26, 2018, 08:25:27 am »
Thanks for the reply but i'm not trying to do all that.  What I did was added a hklm\software key with the type REG_BINARY using a shell to cmd /c.  I was then able to go to the command prompt from windows and do a reg query and find it.  now I just want to know if there is a way using either a shell or creating a .bat file to pass my one data field in the registry as a variable to a qb64 program?

9
QB64 Discussion / registry keys
« on: October 26, 2018, 12:08:49 am »
does anyone know how to read a couple of registry keys that had my program place there using a .bat file shell.  but now how do I have it read them back. I want to be able to input the values I placed there into my qb64 program as a variable.  Any ideas would be greatly appreciated

10
QB64 Discussion / Re: Random Access Files
« on: September 01, 2018, 01:23:29 am »
ya and I won't have any problems hopefully taking care of those notes you left. but actually the game is going to be writing all the stats players will be able to fix some misclicks during the game but not go edit there own stats, gonna have it so they can zero them out and start over every few months if they want to

11
QB64 Discussion / Re: Random Access Files
« on: September 01, 2018, 01:19:48 am »
ya mcneil that just like what I was trying to do and got close a couple times on my trial runs ya looks like what I was questioning when I put all those rems on that post trying to figure out how to use that recordpos function thanks guys this forum way cool.  I could stop by and help out the people that have the really easy questions but you guys are pretty good


12
QB64 Discussion / Re: Random Access Files
« on: August 31, 2018, 05:53:03 pm »
I like it for some reason doing the database by date never occurred to me and like you said can start with the two files already created that will take care of the searching the whole database but I wouldn't want to open a random file for every new player would I? just a record right? then after input of the 2 names in fact that is the only input from the keyboard rest is all mouse if say I had like 50 different players I could just assign the new player the next available file number instead of record number and have that be there id number for the next time they play like if input$ = "joe" then filenum = 48.  I could work that but seems like a lot of files and wouldn't I need 50 if thens to check the previous file numbers for names.  your getting me going there and is that close to what you were trying to say

13
QB64 Discussion / Re: Random Access Files
« on: August 31, 2018, 04:39:21 pm »
thanks codeguy I've never worked with binary files but might have to end up giving that a try i'm supposing the the random file can be opened as binary in the function?

14
QB64 Discussion / Re: Random Access Files
« on: August 31, 2018, 04:06:00 pm »
thanks for all the help guys i'm kinda stuck here trying to incorporate that function bplus gave me into what I had started so i'll post my code and hopefully someone can lead me in the right direction I feel like an idiot for having to ask again at this point but have only been using qb64 for about a month now but I have a large data file when someone besides me and danny want to play I have to go into it manually and add them to the program


TYPE kstats
    name AS STRING * 10
    ktg AS LONG 'keiths total games
    ktw AS LONG 'keiths total wins
    kgd AS LONG 'keiths games against dan
    kwd AS LONG 'keiths wins against dan
    kab AS LONG 'keiths at bats
    kh AS LONG 'keiths hits
    ka AS DOUBLE 'keiths average

END TYPE
DIM SHARED keith AS kstats
recordlen% = LEN(keith)
keith.name = "Keith": keith.ktg = 0: keith.ktw = 0: keith.kgd = 0: keith.kwd = 0: keith.kab = 0: keith.kh = 0: keith.ka = 0
OPEN "kdata " FOR RANDOM AS #1
PUT #1, 1, keith
CLOSE #1


TYPE dstats
    name AS STRING * 10
    dtg AS LONG 'dans total games
    dtw AS LONG 'dans total wins
    dgk AS LONG 'dans games against keith
    dwk AS LONG 'dans wins against keith
    dab AS LONG 'dans at bats
    dh AS LONG 'dans hits
    da AS DOUBLE 'dans average

END TYPE
DIM SHARED danny AS dstats
recordlen% = LEN(danny)
danny.name = "Danny": danny.dtg = 0: danny.dtw = 0: danny.dgk = 0: danny.dwk = 0: danny.dab = 0: danny.dh = 0: danny.da = 0
OPEN "ddata " FOR RANDOM AS #2
PUT #2, 1, danny
CLOSE #2

'from here down my guesses on how to change what i started as 2 seperate random files into one big data file to be able to add names
'first i only need one type with all the same variables the exception being games against other players but just make a seperate file for that
'i'm kinda getting lost here if i use kdata as the type for each record and players for the big data file i'm thinking it would go something like

'open "players" for random as #1
'get #1,,kdata
'close #1
'then the two players enter their names
'input "Player 1 Enter your name ";player1$
'input "Player 2 Enter your name ";player2$
'kdata.name = player1$
'then i would have to call the recordpos function which i'm not sure how to do and check to see if player1 is already on file and what record number
'and when it gets back call it again to check player2


FUNCTION RecordPos (file$, search$) 'file$ = ddata      search$ = danny.name
    f = FREEFILE
    OPEN file$ FOR INPUT AS #f 'file$ = ddata
    FL = LOF(f)
    dat$ = INPUT$(FL, f) '<<<<<<<<<<<<<<<<<<<<< this takes the whole file and loads it into one giant string =dat$
    CLOSE f
    recpos = INSTR(dat$, search$) '>>>>>>>>>>>>>>>>>>>>>> this seaches the giant string for Bob, if finds Bob returns the position in string
    IF recpos THEN RecordPos = recpos \ recLEN + 1 ELSE RecordPos = 0 ' >>> this converts the find position in string to a record number for Random access of that record
END FUNCTION

15
QB64 Discussion / Re: Random Access Files
« on: August 30, 2018, 02:23:52 am »
thanks b plus I copied that code I was going to use seek and a counter but that looks way eaiser. line numbers where kinda neat terry if you forgot a line you could just give it a number in the middle

Pages: [1] 2