## Search found 5519 matches

Feb 14, 2019 20:20
Forum: General
Topic: recreational function approximations
Replies: 9
Views: 242

### Re: recreational function approximations

Thanks srvaldez. with their first function 2*exp(-x)*sin(x) +exp(-2*x) -x^2 +4 although they have it 2*exp(-ɯ)*sin(ɯ) +exp(-2*ɯ) -x^2 +4 (mixing omega and x for some reason) I tried with chebyshev, got slightly different coefficients. Their basic code is very long, and very hard to copy and paste fr...
Feb 14, 2019 19:17
Forum: Beginners
Topic: FileDateTime() for Unicode
Replies: 14
Views: 347

### Re: FileDateTime() for Unicode

There are plenty of examples if you google for C examples. Here is a quickie for a straight file, I'll mess around later for a unicode method. #include "windows.bi" #include "crt.bi" function setfiletocurrent(file as wstring) as boolean 'pulled from google ' Create a systemtime s...
Feb 13, 2019 22:17
Forum: General
Topic: How to "customize" the random generator?
Replies: 18
Views: 443

### Re: How to "customize" the random generator?

A wood near you. redim shared as double cd(1 To 1000001) #define Intrange(f,l) int(Rnd*(((l)+1)-(f)))+(f) #define BiasRange(f,l) Int( cd( Intrange(1,1000001) )*(((l)+1)-(f))) +(f) namespace rnds Function f1(x As Double) As Double If x>0 Then Return x Else Return -x End Function Function Area(fn As F...
Feb 13, 2019 14:29
Forum: General
Topic: How to "customize" the random generator?
Replies: 18
Views: 443

### Re: How to "customize" the random generator?

Neat and simple Richard. I thought firstly that getting a bias random spread from a uniform distribution would be trivial, but the more I look into it the less trivial it gets. I use a cumulative function from a base function which is concave up (for the bias as a central bulge, like Richards) The b...
Feb 12, 2019 19:36
Forum: Windows
Topic: Size Of Control?
Replies: 5
Views: 126

### Re: Size Of Control?

Using the rectangle #include "windows.bi" dim as msg message var main= CreateWindowEx( 0, "#32770", "stretch me", WS_OVERLAPPEDWINDOW Or WS_VISIBLE , 100, 0, 800, 600, 0, 0, 0, 0 ) var box=CreateWindowEx( 0, "static", "" , WS_Border or WS_VISIBLE Or ...
Feb 12, 2019 12:32
Forum: Beginners
Topic: FileDateTime() for Unicode
Replies: 14
Views: 347

### Re: FileDateTime() for Unicode

Here is Josep Roca's function (getter) free from his afx library. (open pipe doesn't get unicode , but I have used it for a running example) #Define UNICODE #include "windows.bi" #include "vbcompat.bi" ' ============================================================================...
Feb 12, 2019 2:17
Forum: Beginners
Topic: FileDateTime() for Unicode
Replies: 14
Views: 347

### Re: FileDateTime() for Unicode

I can run Josep Roca's code from within WinFBX-Master. If I try another folder I get errors from other inc files example error from cwindow.inc File not found, "Afx/AfxCtl.inc" in '#include once "Afx/AfxCtl.inc"' Anyway i got a runner from within WinFBX-Master, comparing the crt ...
Feb 12, 2019 1:12
Forum: Windows
Topic: Scrollable interior
Replies: 9
Views: 226

### Re: Scrollable interior

I can use the mouse wheel, but no success with the scroller yet. #define WIN_INCLUDEALL #include once "windows.bi" #include once "win\commctrl.bi" Dim As MSG msg Dim Shared As HWND hWnd, statics , edit dim as point ep ' Create window hWnd = CreateWindowEx( 0, "#32770", ...
Feb 11, 2019 19:31
Forum: Beginners
Topic: FileDateTime() for Unicode
Replies: 14
Views: 347

### Re: FileDateTime() for Unicode

directory( perhaps containing unicode filenames ) experiment. #include "crt.bi" const size=10000 declare function wsystem_ cdecl alias "_wsystem" (byval as wstring ptr) as long sub save(filename as wstring,content as wstring) 'not used here dim as wstring * 20 w="wt+,ccs=utf...
Feb 11, 2019 14:39
Forum: Beginners
Topic: FileDateTime() for Unicode
Replies: 14
Views: 347

### Re: FileDateTime() for Unicode

You could try the crt functions (they usually have wide string options) #include "crt.bi" dim as _stat filestat dim as wstring* 50 ws= wstr("datetest.txt") 'need your filename var v=_wstat(@ws,@filestat) if v=0 then print, ws;" info" print " File access time "...
Feb 11, 2019 12:59
Forum: General
Topic: How to "customize" the random generator?
Replies: 18
Views: 443

### Re: How to "customize" the random generator?

A cumulative random generator. The bigger the number in a range, the more chance of getting it. 'numerical integration (trapezium method) Function area(fn As Function(x As Double) As Double,L As Double,U As Double,Ordinates As Integer=10) As Double Var h=(U-L)/ordinates,x=L Var f=fn(U),Sum=h*(f+fn(L...
Feb 11, 2019 2:28
Forum: Windows
Topic: Windows Button Image
Replies: 25
Views: 490

### Re: Windows Button Image

Thanks albert.
I have just edited it( deleteobject(hbitmap(n)) ... to free the memory at each loadimage update.
Feb 11, 2019 1:16
Forum: Windows
Topic: Windows Button Image
Replies: 25
Views: 490

### Re: Windows Button Image

Hey Albert randomize #include once "windows.bi" #include "fbgfx.bi" Declare Sub DrawFont(Byref BUFFER As Any Ptr=0,Byval POSX As Long, Byval POSY As Long, _ Byref FTEXT As String, Byref FNAME As String,Byval FSIZE As Long, _ Byval FCOLOR As Ulong=Rgba(220,86,37,255),Byval FSTYLE ...
Feb 09, 2019 22:36
Forum: Windows
Topic: Windows Button Image
Replies: 25
Views: 490

### Re: Windows Button Image

Using bitmaps is very easy Albert, and you can make sure everything is cleaned up by a destructor sub. But I shall investigate other ways (I am a bit rusty on win api) run this in a temp folder. #include once "windows.bi" dim shared as any ptr i(1 to 88 ) DIM szBitmap(lbound(i) to ubound(i...
Feb 09, 2019 19:23
Forum: Windows
Topic: Windows Button Image
Replies: 25
Views: 490

### Re: Windows Button Image

Maybe something like #include once "windows.bi" sub getsize(picture as string,byref dimensionx as long,byref dimensiony as long) Open picture For Binary access read As #1 Get #1, 19, dimensionx Get #1, 23, dimensiony Close #1 end sub DIM szBitmap AS STRING ' = "C:\Users\User\Desktop\d...

Go to advanced search