Ariane Soft PPL2 Pocket Programming DataMite

Go Back   ArianeSoft Forums > PPL version 2 > Code Sharing

Thread Tools Search this Thread Display Modes
Old 03-29-2010, 03:53 PM
Nicknack Nicknack is offline
Senior Member
Join Date: Nov 2006
Location: Germany
Posts: 527
Default your own bitfield / status flags like spriteoptions

was not much work. taken the example on wikipedia and ported it to PPL. maybe useful for somebody:
PHP Code:
#define LIKES_ICE_CREAM  (1 << 0) // 0x01 
#define PLAYS_GOLF (1 << 1) // 0x02 
#define WATCHES_TV  (1 << 2) // 0x04 
#define READS_BOOKS (1 << 3) // 0x08 

proc set_preference(flag$) 
preference$ |= flag$;

proc reset_preference(flag$) 
preference$ = (preference$ ^ flag$);

func get_preference(flag$) 
  return (
preference$ & flag$ !=0);

proc main
reset_preference(PLAYS_GOLF) ;
Showmessage(get_preference(PLAYS_GOLF) );
Showmessage(get_preference(READS_BOOKS) );
Reply With Quote

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

All times are GMT. The time now is 09:39 AM.

Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2022, Jelsoft Enterprises Ltd.
Copyright (c) ArianeSoft Inc.
Copyright © 2009 - All rights reserved
Web Design by BR Web Consulting Ltd