Search found 312 matches

by coder14
Thu Dec 24, 2020 12:50 pm
Forum: Coding Questions
Topic: Looking for a PureBasic Tutor/Mentor...
Replies: 13
Views: 2647

Re: Looking for a PureBasic Tutor/Mentor...

The best and easiest to understand tutorial to get you started.

viewtopic.php?f=22&t=64684
by coder14
Thu Oct 17, 2019 6:42 pm
Forum: Off Topic
Topic: Shared Hosting & Web Service Question
Replies: 2
Views: 3362

Shared Hosting & Web Service Question

I've been going through hosting hell this past week with one host suspending my account and another blacklisting my IP.

One claims that I'm overusing the resources for a shared hosting plan, and the other claims that my system is bruteforcing their servers.

The only new thing that I had added is a ...
by coder14
Sun Apr 30, 2017 4:13 pm
Forum: Off Topic
Topic: Help me defend PB "reputation"
Replies: 76
Views: 40358

Re: Help me defend PB "reputation"

when I mention PB, they start to grin from ear to ear at me with sarcastic smile
You can make money from your PureBasic apps; here's my current Inbox for inspiration. Show them this post and see how they come up more ways to rubbish PureBasic, despite the fact that it's making me good money at a ...
by coder14
Mon Mar 13, 2017 2:12 am
Forum: Feature Requests and Wishlists
Topic: Logical NOT Operator (' ! ') in If-statements.
Replies: 25
Views: 8522

Re: Logical NOT Operator (' ! ') in If-statements.

On the flip side this should not work either: a.s = ""
b.s = "abc"
If a : Debug "a" : EndIf
If b : Debug "b" : EndIf But it does. :lol:
Well, it only shows "b" in the Debug Output for me. So, it works correct here.
That's boolean on strings - so NOT should work too.

Technically if (If a$) is ...
by coder14
Sun Mar 12, 2017 4:38 am
Forum: Feature Requests and Wishlists
Topic: Logical NOT Operator (' ! ') in If-statements.
Replies: 25
Views: 8522

Re: Logical NOT Operator (' ! ') in If-statements.

On the flip side this should not work either:

Code: Select all

a.s = ""
b.s = "abc"
If a : Debug "a" : EndIf
If b : Debug "b" : EndIf
But it does. :lol:
by coder14
Sun Mar 12, 2017 4:28 am
Forum: Mac OSX
Topic: Working with CFNotificationCenter
Replies: 3
Views: 4175

Re: Working with CFNotificationCenter

Thank you wilbert! Amazing work! :D :D :D

This must be added to the Mac forum stickies for future reference.
by coder14
Sun Mar 12, 2017 4:25 am
Forum: Mac OSX
Topic: Command line args if launched from terminal
Replies: 17
Views: 8062

Re: Command line args if launched from terminal

Maybe you can use -n from the terminal to open a second instance and use CFNotificationCenter to send the string to the original application.
http://www.purebasic.fr/english/viewtopic.php?f=19&t=68047 WOW!!! :shock:

That's exactly what I'm looking for and it works perfectly! Thank you so much ...
by coder14
Tue Mar 07, 2017 8:51 am
Forum: Mac OSX
Topic: Command line args if launched from terminal
Replies: 17
Views: 8062

Re: Command line args if launched from terminal

I don't know if it is even possible what you want.

Did you consider alternative options like using AppleScript to tell to your already running application what you want it to do ?
The running instance would not even know that a second instance is being launched. But when the second instance is ...
by coder14
Tue Mar 07, 2017 8:12 am
Forum: Mac OSX
Topic: Command line args if launched from terminal
Replies: 17
Views: 8062

Re: Command line args if launched from terminal

Can you give us a function description of what do you exactly want?

Do you want that all instances do the same or different things?
By default Mac does not allow multiple instances of an app to run concurrently. If an instance is already running, trying to launch it again using the command-line ...
by coder14
Mon Mar 06, 2017 9:14 am
Forum: Mac OSX
Topic: Command line args if launched from terminal
Replies: 17
Views: 8062

Re: Command line args if launched from terminal

wilbert wrote:
coder14 wrote:Is there a way or are the parameters lost forever?
I'm confused right now about what you want.

Do you mean that if you use

Code: Select all

open -a myApp.app --args params
you want the arguments to be passed to the instance that is already running ?
Yes! :D
by coder14
Mon Mar 06, 2017 8:51 am
Forum: Mac OSX
Topic: Command line args if launched from terminal
Replies: 17
Views: 8062

Re: Command line args if launched from terminal

Thank you for your answers. CountProgramParameters and ProgramParameter works in the first instance. But how do i get the parameters from the second instance.

Starting my app from Terminal :
1. I launch my app (from Terminal or Finder doesn't matter). While this instance is running:
2. I launch ...
by coder14
Sun Mar 05, 2017 4:04 pm
Forum: Mac OSX
Topic: Command line args if launched from terminal
Replies: 17
Views: 8062

Re: Command line args if launched from terminal

MacOS allows only a single instance by default.

This is not 100% true, because if you run this inside a new terminal window you will get a new program running.
/Applications/TextEdit.app/Contents/MacOS/TextEdit

Only if you run the .app packet OSX will not open a second version of it.
But how ...
by coder14
Sun Mar 05, 2017 2:28 pm
Forum: Mac OSX
Topic: Command line args if launched from terminal
Replies: 17
Views: 8062

Re: Command line args if launched from terminal

Maybe you can do it like this:


Global Window_0, Button_0


Procedure isAlreadyRunning()

thisApp =CocoaMessage(0,0, "NSRunningApplication currentApplication")
thisAppName =CocoaMessage(0, thisApp, "localizedName")

If thisAppName
thisName.s =PeekS(CocoaMessage(0, thisAppName, "UTF8String ...
by coder14
Sat Mar 04, 2017 6:02 pm
Forum: Mac OSX
Topic: Command line args if launched from terminal
Replies: 17
Views: 8062

Command line args if launched from terminal

MacOS does not launch multiple instances of the same app by default. If an associated file is double-clicked in Finder when an instance of the app is already running we can get the file name with this callback routine from Fred:

http://forums.purebasic.com/english/viewtopic.php?p=391284&sid ...
by coder14
Mon Feb 27, 2017 4:03 am
Forum: Mac OSX
Topic: Text Selection/Highlight Color for Editor or String Gadget
Replies: 5
Views: 4349

Re: Text Selection/Highlight Color for Editor or String Gadg

Something like this ?
If OpenWindow(0, 0, 0, 322, 150, "EditorGadget", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
EditorGadget(0, 8, 8, 306, 133)

Attributes = CocoaMessage(0, 0, "NSDictionary dictionaryWithObject:",
CocoaMessage(0, 0, "NSColor orangeColor"),
"forKey ...