Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Professional Discussion / opening programs creating programs playing mpeg files and messagebox pop-up

Author
Message
Dancelot Gaiming
4
Years of Service
User Offline
Joined: 11th Oct 2019
Location:
Posted: 7th Oct 2021 21:27
is there a code for
-playing video files like mpeg
-message box pop-up
-opening programs (executable text files etc)
-creating files (text files)

also yes I'm a newbie on dark basic pro I heard the program is discontinued but I'm glad that the community is still active to this day

anyways can you guys help me for something I need some codes for the reason above
Bored of the Rings
User Banned
Posted: 8th Oct 2021 12:05 Edited at: 8th Oct 2021 12:05
- message popup - if you install BLUEGUI you can use the message, warningmessage etc commands, otherwise look at api dll e.g. user32.dll
--mpeg - I can' t recall top of my head, see DBPro help files should be in there with examples
-opening programs : use the EXECUTE command e.g. code below excerpt only:


-Creating text files: see code example below :

Professional Programmer, languages: SAS, C++, SQL, PL-SQL, DBPro, Purebasic, JavaScript, others
Dancelot Gaiming
4
Years of Service
User Offline
Joined: 11th Oct 2019
Location:
Posted: 8th Oct 2021 16:08


ok so the opening file code works but the creating files for some reason doesn't also how do I use BLUEGUI?
Bored of the Rings
User Banned
Posted: 8th Oct 2021 16:39
that's just example code. comment out my specific code related to rawlist array. you can ouput whatever you want e.g. write string 1,"this is a piece of text".

for blugui, see a couple of links below, it's a GUI plugin but has commands message and warningmessage that you might find useful:

https://forum.thegamecreators.com/thread/209598
https://forum.thegamecreators.com/thread/198156
Professional Programmer, languages: SAS, C++, SQL, PL-SQL, DBPro, Purebasic, JavaScript, others
Dancelot Gaiming
4
Years of Service
User Offline
Joined: 11th Oct 2019
Location:
Posted: 9th Oct 2021 01:52
i'm sorry to say this these links won't help me (maybe because my English is not that good)

can you give me like a code that makes messagebox like a popup message with a OK button code?
Raven
19
Years of Service
User Offline
Joined: 23rd Mar 2005
Location: Hertfordshire, England
Posted: 9th Oct 2021 03:59
Quote: "is there a code for
-playing video files like mpeg
-message box pop-up
-opening programs (executable text files etc)
-creating files (text files)"


I'd always check the Code Snippets Forum., as it was mainly used by the DBP Community... the AppGameKit Community more or less ignores it exists.
You can almost always find a Snippet for DBP showcasing what you're looking for in there.

With this said., I'll tackle these in order:

Quote: "-playing video files like mpeg"


DarkBASIC Professional is entirely Windows / DirectX 9.0c Based (unlike AppGameKit which uses Multiple Cross-Platform API with more Hardcoded approaches).
What this means is that the Video Functions are entirely built on DirectShow., which is a Format Independent Video Playback API that integrates with DirectX (specifically DirectX 7 - 9).
This means that provided the Video Codec is installed (many common formats are by default in Modern Windows)., then you can Load and Play it within DBP.

Today., this essentially means all Common Formats; as their Codecs are installed by Default in Windows... but what you can do., is have a small "Test" File in the Format you want to use.
i.e.



This is a useful approach to the function., because a Return of False (0) means we have no available slots to load with... this is a YOU (Program) issue., as you're using too many Animation Slots; where-as a True (-1) Value means the Video Failed to Load.
And then any Positive Value means it Loaded just Fine.

As such we can then use a Select...Case Statement (Finite State Machine), to handle each of these.
So say:



Now as a note., these are just EXAMPLES of how you can do it, not a Copy-Paste Solution.
And I've written it deliberately in a way that you can't just copy it into your project... as I'm not writing your App/Game for you., this is a learning tool to understand how to do it yourself.

Quote: "-message box pop-up"


Buried somewhere in DBP is actually a Command for a Message Prompt... but I forgot what it is and the only one that the Help Files lists (as I recall) is the Exit Prompt; which has limited usage, as well it ends the App.
As noted there are various 3rd Party DLL Plug-Ins that do provide this functionality., although I never used any, so couldn't tell you which.

Still a useful aspect of DBP is that we can directly call ANY Windows Function provided we know how to access it.
This gets into more advanced programming., so here's a self-contained Function.



Now of course if you want a "Custom" Message Box., well you have to use Dialog Boxes and that's a bit more involved to write.
Again there are 3rd Party DLLs for doing this... but you can just as easily do it in a similar method to the above Message Box.
It'd just take much longer to write than this did.

Quote: "-opening programs (executable text files etc)"


See Above... although keep in mind., not sure if it's an issue with Windows 10 or DBP v1.7x but the Execute Executable doesn't fully support Command Parameters.

Quote: "-creating files (text files)"


F1 > Commands > File Commands
Just check the Help, as the example is for Text Files
Dancelot Gaiming
4
Years of Service
User Offline
Joined: 11th Oct 2019
Location:
Posted: 9th Oct 2021 06:41


so i tried the message box code from blueGUI plugin I installed the plugin but for some reason the codes don't work did I do something wrong?

Login to post a reply

Server time is: 2024-04-25 16:15:14
Your offset time is: 2024-04-25 16:15:14