• Print

Author Topic: _MEMORYEXISTS not in the Wiki  (Read 151 times)

Cyperium

  • Hero Member
  • *****
  • Posts: 3336
  • Knowledge is good, but understanding is better
    • Cyperium
    • Email
_MEMORYEXISTS not in the Wiki
« on: April 30, 2013, 05:42:43 PM »
Just letting you know, it is referenced in the _MEM page and used in the example: http://qb64.net/wiki/index.php?title=MEM

I'm still pretty new to _MEM and what the functions return, so it's probably better that you (Clippy) or someone else that can edit the Wiki adds it.
Venture - New Prototype, QB64 Editor v1.95b (linux compatible, if you compile the source).

Clippy

  • Hero Member
  • *****
  • Posts: 16446
  • I LOVE π = 4 * ATN(1)    Use the QB64 WIKI >>>
    • Pete's Qbasic Site
    • Email
Re: _MEMORYEXISTS not in the Wiki
« Reply #1 on: May 01, 2013, 12:20:34 AM »
You add it. I'm through with it!
QB64 WIKI: Main Page
Download Q-Basics Code Demo: Q-Basics.zip
Download QB64 BAT, IconAdder and VBS shortcuts: QB64BAT.zip
Download QB64 DLL files in a ZIP: Program64.zip

Cyperium

  • Hero Member
  • *****
  • Posts: 3336
  • Knowledge is good, but understanding is better
    • Cyperium
    • Email
Re: _MEMORYEXISTS not in the Wiki
« Reply #2 on: May 01, 2013, 10:13:15 AM »
Ok, I didn't know. I'll add it later when I've learned what it returns and all that. I'm doing some research into _MEM anyway to see if I can apply it to the variables or to other projects. Besides I'm going to have to add it to my editor help also.
Venture - New Prototype, QB64 Editor v1.95b (linux compatible, if you compile the source).

Galleon

  • Administrator
  • Hero Member
  • *****
  • Posts: 4711
  • QB Forever
    • Email
Re: _MEMORYEXISTS not in the Wiki
« Reply #3 on: May 03, 2013, 09:30:19 PM »
It returns boolean (-1 [true] if it exists, 0 false if not).

Typically, this function is used by a library of SUBs/FUNCTIONs which accept a _MEM structure as input. To avoid an uninformative error related to the internals of the library they can give an informative error to the user that they passed an invalid mem block to the SUB/FUNCTION or handle the issue as the library sees fit.
« Last Edit: May 03, 2013, 10:28:00 PM by Galleon »
Something old... Something new... Something borrowed... Something blue...

Cyperium

  • Hero Member
  • *****
  • Posts: 3336
  • Knowledge is good, but understanding is better
    • Cyperium
    • Email
Re: _MEMORYEXISTS not in the Wiki
« Reply #4 on: May 04, 2013, 04:36:19 AM »
Thanks for the info.

Mem now exists! ...I mean page now exists!

_MEMEXISTS

« Last Edit: May 04, 2013, 04:43:24 AM by Cyperium »
Venture - New Prototype, QB64 Editor v1.95b (linux compatible, if you compile the source).

Galleon

  • Administrator
  • Hero Member
  • *****
  • Posts: 4711
  • QB Forever
    • Email
Re: _MEMORYEXISTS not in the Wiki
« Reply #5 on: May 04, 2013, 04:12:48 PM »
I reworded the 2nd point because the caller of the sub/function should actually know if the block exists, only through error would they have passed an invalid block to a function/sub. The sub/function however, has no idea what it will be passed and may want to validate it (if time permits).
Something old... Something new... Something borrowed... Something blue...

Cyperium

  • Hero Member
  • *****
  • Posts: 3336
  • Knowledge is good, but understanding is better
    • Cyperium
    • Email
Re: _MEMORYEXISTS not in the Wiki
« Reply #6 on: May 04, 2013, 05:14:13 PM »
Ok, thanks. I've added _SNDRAWOPEN as well and made some other changes (added the optional handle argument to _SNDRAW too).

I'm going to keep an open eye for changes needed in the Wiki while Clippy is gone (from editing the wiki, that is).
Venture - New Prototype, QB64 Editor v1.95b (linux compatible, if you compile the source).

Galleon

  • Administrator
  • Hero Member
  • *****
  • Posts: 4711
  • QB Forever
    • Email
Re: _MEMORYEXISTS not in the Wiki
« Reply #7 on: May 04, 2013, 06:07:03 PM »
Thanks Cyperium

I kinda dropped the ball on new Wiki access members but it's probably time I opened it up again.
Something old... Something new... Something borrowed... Something blue...

Cyperium

  • Hero Member
  • *****
  • Posts: 3336
  • Knowledge is good, but understanding is better
    • Cyperium
    • Email
Re: _MEMORYEXISTS not in the Wiki
« Reply #8 on: May 05, 2013, 06:03:02 AM »
Ok, I see MystikShadow wants in, he has edited the wiki before as early as July 2009 (User contributions). We said before that we would only accept senior members but I think we could make a exception with him. Otherwise I think we should stick to that rule, so we have at least some idea as to who we are dealing with.
Venture - New Prototype, QB64 Editor v1.95b (linux compatible, if you compile the source).

Pete

  • Moderator
  • Hero Member
  • *****
  • Posts: 6329
  • Cuz I sez so varmint!
Re: _MEMORYEXISTS not in the Wiki
« Reply #9 on: May 05, 2013, 11:27:50 AM »
Myst is a senior member as far as I'm concerned, too. He has been programming in QB for nearly as long as I have. The only difference is, I'm the guy who invented fire, Myst merely ported it to SCREEN 13.

Pete  ;D
It's only rocket science; it's not Linux!

  • Print