PlanetSquires Forums

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 ... 10 11 [12]

Author Topic: Josť, if you're bored...  (Read 3058 times)

Josť Roca

  • Moderator
  • Master Member
  • *****
  • Posts: 3083
    • Jos
Re: Josť, if you're bored...
« Reply #165 on: September 14, 2018, 05:29:45 PM »

Hi guys, if you're bored... you can test a new data type, CInt96.

CInt96 is a wrapper class for the DECIMAL data type. Holds signed 128-bit (16-byte) values representing 96-bit (12-byte) integer numbers. The largest possible value is +/-79,228,162,514,264,337,593,543,950,335.

Documentation: https://github.com/JoseRoca/WinFBX/blob/master/docs/Numeric%20datatypes/CInt96%20Class.md

Johan Klassen

  • FireFly3 Registered User
  • Junior Member
  • *
  • Posts: 70
  • FF3 User
Re: Josť, if you're bored...
« Reply #166 on: September 14, 2018, 08:04:41 PM »

hello Josť Roca
my small test show that it works ok, tried both 32 and 64 bit, thanks Josť
Logged

Josť Roca

  • Moderator
  • Master Member
  • *****
  • Posts: 3083
    • Jos
Re: Josť, if you're bored...
« Reply #167 on: September 14, 2018, 09:00:40 PM »

Thanks for testing. There are many big numbers libraries, but this class if fast, and 29 digits should be enough for most tasks.

Josť Roca

  • Moderator
  • Master Member
  • *****
  • Posts: 3083
    • Jos
Re: Josť, if you're bored...
« Reply #168 on: September 16, 2018, 11:21:46 AM »

New class: CMemMapFile (memory-mapped files).

Documentation:
https://github.com/JoseRoca/WinFBX/blob/master/docs/File%20Management/CMemMapFile%20Class.md

Wikipedia article:
https://en.wikipedia.org/wiki/Memory-mapped_file

Usage example:

Example
The following code maps the contents of the ansi file "textA.txt", retrieves access to the data and converts it to lower case.

Code: [Select]
#INCLUDE ONCE "windows.bi"
#INCLUDE ONCE "Afx/CMemMapFile.inc"

DIM pMemMap AS CMemMapFile
IF pMemMap.MapFile(AfxGetExePath & "/testA.txt") THEN
   DIM pData AS ANY PTR = pMemMap.AccessData(100)
   IF pData THEN
      CharLowerBuffA(pData, pMemMap.GetFileSize)
      pMemMap.UnaccessData
   END IF
   pMemMap.Unmap
END IF

Unicode:

Code: [Select]
#INCLUDE ONCE "windows.bi"
#INCLUDE ONCE "Afx/CMemMapFile.inc"

DIM pMemMap AS CMemMapFile
IF pMemMap.MapFile(AfxGetExePath & "/testW.txt") THEN
   DIM pData AS ANY PTR = pMemMap.AccessData(100)
   IF pData THEN
      CharLowerBuffW(pData, pMemMap.GetFileSize)
      pMemMap.UnaccessData
   END IF
   pMemMap.Unmap
END IF
« Last Edit: September 16, 2018, 11:26:08 AM by Josť Roca »
Logged

Josť Roca

  • Moderator
  • Master Member
  • *****
  • Posts: 3083
    • Jos
Re: Josť, if you're bored...
« Reply #169 on: September 16, 2018, 04:00:17 PM »

CMaskEdit: Fixed a problem with Undo not working after deleting characters.
« Last Edit: September 16, 2018, 04:12:24 PM by Josť Roca »
Logged

Josť Roca

  • Moderator
  • Master Member
  • *****
  • Posts: 3083
    • Jos
Re: Josť, if you're bored...
« Reply #170 on: September 17, 2018, 03:28:42 AM »

CMaskedEdit

- Removed the DisableMask method. It was causing many problems and it is not needed: if you want an standard edit control, use it instead of a MskedEdit control with the mask disabled.

- Changed SetWindowText to SetText, GetWindowTextLength to GetTextLenght, and GetWindowText to GetText.

- Added SetMaskedText.

- The cursor now is positioned automatically at the beginning of a group, without having to call SetPos.

Documentation updated:
https://github.com/JoseRoca/WinFBX/blob/master/docs/Windows%20GUI/CMaskedEdit%20Class.md
Pages: 1 ... 10 11 [12]