Search found 21 matches

by CSHW89
Sun Oct 03, 2021 5:06 pm
Forum: Feature Requests and Wishlists
Topic: PB6.0 Alpha 5 - Label address in datasection (?Label)
Replies: 6
Views: 2259

Re: PB6.0 Alpha 5 - Label address in datasection (?Label)

Yes, of course. But again, I don't want to change my code. It shouldn't be a workaround in the PB code. It's part of the PB language and the compiler should be able to handle it. My idea is a possible implementation in the compiler. For each label address in a datasection replace it with a zero and ...
by CSHW89
Sun Oct 03, 2021 1:42 pm
Forum: Feature Requests and Wishlists
Topic: PB6.0 Alpha 5 - Label address in datasection (?Label)
Replies: 6
Views: 2259

Re: PB6.0 Alpha 5 - Label address in datasection (?Label)

There are many possible solutions to avoid label addresses in datasection. But I'm trying to find a solution for the compiler so that no changes to the pb code are necessary. I write a code generator that uses many addresses in datasections.
by CSHW89
Sun Oct 03, 2021 1:15 pm
Forum: Feature Requests and Wishlists
Topic: PB6.0 Alpha 5 - Label address in datasection (?Label)
Replies: 6
Views: 2259

PB6.0 Alpha 5 - Label address in datasection (?Label)

Hello team,

I know, there is a restriction "No Label address in datasection (?Label)". Maybe, I have a solution for that. I've analyzed a bit. The following code works with ASM backend, but not with the C backend.
Structure Inner
b.i
EndStructure

Structure Struct
a.i
*inner.Inner
EndStructure ...
by CSHW89
Sun Jan 29, 2017 12:40 am
Forum: Coding Questions
Topic: dynamically allocate structure
Replies: 12
Views: 2891

Re: dynamically allocate structure

I hope, i understand your problem correctly. The variable 'objects' in 'objects' can not be a pointer, since you want that the memory is contiguous. But you need a pointer to store the allocated memory. You can easily return this. Additionally you dont need the MAXITEMS-constant.
Structure object ...
by CSHW89
Wed Apr 27, 2016 9:04 pm
Forum: Feature Requests and Wishlists
Topic: Array,List,Map of pointers of an undefined structure
Replies: 0
Views: 1255

Array,List,Map of pointers of an undefined structure

It is possible to define a pointer in a structure with an undefined structure. Thereby you can define cycle structures:
Structure Main
*pointer.SubStruc
*noerror.ANonexistentStruc
EndStructure

Structure SubStruc Extends Main
foo.i
EndStructure

test.Main
test\pointer\foo = 2 ; it works, because ...
by CSHW89
Mon Jul 14, 2014 4:41 pm
Forum: Announcement
Topic: PurePunch Contest July-August 2014
Replies: 113
Views: 67718

Re: PurePunch Contest July-August 2014

Wow, thanks all for your replies. I shrank the code from 35 to 28 lines :). Link
by CSHW89
Sun Jul 13, 2014 2:32 pm
Forum: Announcement
Topic: PurePunch Contest July-August 2014
Replies: 113
Views: 67718

Re: PurePunch Contest July-August 2014

@heartbone: Oh yes, you are right. I changed it to black & white ;)
by CSHW89
Sun Jul 13, 2014 12:43 pm
Forum: Announcement
Topic: PurePunch Contest July-August 2014
Replies: 113
Views: 67718

Re: PurePunch Contest July-August 2014

My Punch, a mastermind clone in 35 (now 28) lines :D :
;*******************************************************************************
;*
;* July-August 2014 PurePunch contest
;* PureBasic 5.22
;* 50 lines of 80 chars, 2 months delay
;*
;* Name : Mastermind
;* Author : cshw89
;* Date : 14/07/14 ...
by CSHW89
Sat May 31, 2014 11:40 am
Forum: Announcement
Topic: PureBasic 5.30 beta 9 released!
Replies: 195
Views: 91578

Re: PureBasic 5.30 beta 1 released!

Wow, great features in particular the new PREPROCESS compiler flag. But for simpler implementation of precompiler is it possible to insert a new tool trigger in the "tool-chain" like this?

Run tools with trigger "Before Compile/Run"
PREPROCESS
Run tools with new trigger "After Preprocess"
COMPILE ...
by CSHW89
Mon Jul 29, 2013 11:46 pm
Forum: Tricks 'n' Tips
Topic: ScrollBar With Tracking
Replies: 15
Views: 8345

Re: ScrollBar With Tracking

@Psych: Great code! Thanks :D

@minimy: Here is a simple example: Procedure ScrollProc(SbarID,Msg,wParam,*lParam.SCROLLINFO)
With *lParam
Protected result,*defproc=GetProp_(SbarID,@"scrollbar_winproc")
If *defproc
result=CallWindowProc_(*defproc,SbarID,Msg,wParam,*lParam)
EndIf
If Msg=#SBM ...
by CSHW89
Sat Mar 02, 2013 12:11 am
Forum: Feature Requests and Wishlists
Topic: Bool() with constants => constant
Replies: 1
Views: 544

Bool() with constants => constant

Can the function "Bool" with constants be evaluated at compile time?

Work with PB 5.00:
Macro enum2pow(_const_)
_const_ = ((#PB_Compiler_EnumerationValue=1 And 1) + (#PB_Compiler_EnumerationValue>1 And 1) * ((#PB_Compiler_EnumerationValue-1)<<1))
EndMacro

Enumeration 1
enum2pow(#A1) ;1 ...
by CSHW89
Sun Jan 20, 2013 2:34 pm
Forum: Feature Requests and Wishlists
Topic: Rightclick support for ListViewGadget
Replies: 13
Views: 4653

Re: Rightclick support for ListViewGadget

+1 for RightClick and RightDoubleClick

@Guimauve: But in your case you can use #LVS_NOCOLUMNHEADER: If OpenWindow(0, 0, 0, 400, 300, "Test")
ListIconGadget(0, 10, 10, 380, 280, "", 355, #LVS_NOCOLUMNHEADER)
For i = 0 To 99
AddGadgetItem(0, -1, Str(i+1)+". Element")
Next

Repeat: Until ...
by CSHW89
Thu Sep 13, 2012 4:44 pm
Forum: Feature Requests and Wishlists
Topic: [Implemented] FillMemory(,, #PB_Character)
Replies: 2
Views: 1630

Re: FillMemory(,, #PB_Character)

Here a workaround: Procedure FillMemory_(_memory_, _size_, _value_=0, _type_=#PB_Byte)
FillMemory(_memory_, _size_, _value_, _type_)
EndProcedure

Macro FillMemory(_memory_, _size_, _value_=0, _type_=#PB_Byte)
CompilerIf (_type_ = #PB_Character)
CompilerIf (SizeOf(Character) = 1)
FillMemory ...
by CSHW89
Wed May 02, 2012 10:49 am
Forum: Feature Requests and Wishlists
Topic: IDE + Tools + StopCompile
Replies: 1
Views: 602

IDE + Tools + StopCompile

Hi,
i'm currently writing a precompiler. If it found an error in a sourcecode and it ended with an exitcode <> 0, it would be useful if the IDE doesn't compile the sourcecode. e.g:

My Precompiler: ;...
Procedure CheckCode(file.s)
;...
If (error)
MessageRequester("MyPrecompiler", "Syntax error ...