Recent Posts

Pages: 1 ... 6 7 [8] 9 10
71
Networks / Re: Send an e-mail with a click of a button
« Last post by Malkom on November 11, 2020, 11:25:30 AM »
Hello guys, new to programming, i have just created my interface which includes a picture canvas and a single button. I want, when someone clicks the button an e-mail with subject "TEST" and message "It's me!" to be sent to a specific recipient. How can i make it work?

Hello,

Below is a script that you can place in your button to send an email. Note, it requires a field on the card where it can place the result, either 0 for fail, or 1 for sent.

By the way, the script does not work with my web host because they are very security conscious and do not allow port 25 to be used.
They mandate port 587 with START TLS security that HN does not support.

However, if your web host allows port 25, or 587 without the extra security, then the script should work.


Code: [Select]
Local port,server,username,password
Local res


Put 25 into port
Put 'mail.yourdomain.com' into server
Put 'name@yourdomain.com' into username
Put '123456789' into password

EmailSetServer(port,server,username,password)

EmailCreateNew

EmailSetFrom(username)

EmailSetTo('friend@somedomain.com')

EmailSetSubject('TEST')

EmailSetBodyPlain('It's me!')


Put EmailSendFN(600) into res
Put res into field 1

72
Networks / Send an e-mail with a click of a button
« Last post by zero1080 on November 10, 2020, 11:21:13 AM »
Hello guys, new to programming, i have just created my interface which includes a picture canvas and a single button. I want, when someone clicks the button an e-mail with subject "TEST" and message "It's me!" to be sent to a specific recipient. How can i make it work? 
73
Development Progress / October 2020
« Last post by Malkom on October 31, 2020, 02:14:21 PM »
Here is a brief progress report on HN5 development for the month of October 2020.

The aim is to get the Chart demo project running inside HN5 Creator IDE.

The development is being carried out on a Windows 7 x64 machine with regular testing of HN5 on Linux(Lubuntu).

The development language is Free Pascal which should ensure HN5 will be able to run on a variety of Operating Systems, both newer and older versions. The main targets being Windows, OS X and Linux.


COMPILER

The compiler and debugger is being tested, debugged and integrated into the Editor.

It can already compile much of the Chart project.


74
Getting Started / Re: Standalone Location & Movie Help
« Last post by Malkom on October 26, 2020, 06:03:14 AM »
Thank you! I still can't find my project folder.

About your project folder. If you forgot to create a new project then the default project folder will  be used.

The path is  something like: C:\Users\Malkom\Documents\My HyperNext 4\Default_CR

The path will be roughly  similar for OS X.

Note,
If you want to turn your project in the default folder into a new project, for instance MoviePlayer then:
  • Copy the folder - Default_CR to another location.
  • Rename the Default_CR folder to MoviePlayer.
  • Inside the new project folder, rename Default_CR.prj to MoviePlayer.prj.



When I put in a 'go back' button on my movie's card and click it, it takes me back to the desired card, but the movie doesn't go away. How do I fix this? I've tried MovieSetView, MovieViewFN, and such to no avail.

This is actually a bug when the movie player doesn't hide on a card without its own movie player.

A workaround is to add the the follwing in your target card's open event:

Code: [Select]
MovieSetHeight(1,0)

MovieSetView(1,0)

If you want it in the button, then disable the Button Goto, and place this in the button's script:

Code: [Select]
MovieSetHeight(1,0)

MovieSetView(1,0)

Gotocard 2
75
Getting Started / Re: Standalone Location & Movie Help
« Last post by Dystopia on October 23, 2020, 09:04:33 PM »
I tried compiling my program. It goes through alright. Now I'm having issues finding where it puts the file.
When HN builds an app(executable) or stack, it places the built app/stack in the project's folder.
For instance if your project is called My Movie Player, then the built app/stack should be in the My Movie Player folder.

Note, when releasing your app or stack, the original project file is not required but remember to make a copy of it somewhere.
Only the app/stack plus any dependencies such as datafiles, images, vidoe setc are required.


As for movies, when I run my program and try to start the movie, it doesn't start. What am I doing wrong?
There is a bug in a movie player's control panel that prevents some movies such as MP4 from playing.

See number 5 in this post:-
http://www.tigabyte.com/smf/index.php?topic=326.0

However, it is possible to control a movie, play or pause it by using the relevant movie command.
 
In the scripts below, the movie player control on the card has ID 1.

The movie to be played was dragged and dropped intoto the project's movie library via the Movie Library menu option  under the menu Windows.
 

Use one button  to play the movie with the command MoviePlayNormalSpeed:-
Code: [Select]
MoviePlayNormalSpeed(1)


Use another button  to pause the movie with the command MoviePause:-
Code: [Select]
MoviePause(1)


As a movie player's controller is bugged, it can be hidden using the command MovieSetController.
Its usual to place this or similar commands in the card's open event:-
Code: [Select]
MovieSetController(1,0)



Attached below is a simple movie player that has a small movie in the project folder.

More MP4 movies can be found here:-
https://file-examples.com/index.php/sample-video-files/sample-mp4-files/



Thank you! I still can't find my project folder, but the movie issue is resolved. Another has appeared, though. When I put in a 'go back' button on my movie's card and click it, it takes me back to the desired card, but the movie doesn't go away. How do I fix this? I've tried MovieSetView, MovieViewFN, and such to no avail.
76
Getting Started / Re: Standalone Location & Movie Help
« Last post by Malkom on October 22, 2020, 06:20:04 PM »
I tried compiling my program. It goes through alright. Now I'm having issues finding where it puts the file.
When HN builds an app(executable) or stack, it places the built app/stack in the project's folder.
For instance if your project is called My Movie Player, then the built app/stack should be in the My Movie Player folder.

Note, when releasing your app or stack, the original project file is not required but remember to make a copy of it somewhere.
Only the app/stack plus any dependencies such as datafiles, images, vidoe setc are required.


As for movies, when I run my program and try to start the movie, it doesn't start. What am I doing wrong?
There is a bug in a movie player's control panel that prevents some movies such as MP4 from playing.

See number 5 in this post:-
http://www.tigabyte.com/smf/index.php?topic=326.0

However, it is possible to control a movie, play or pause it by using the relevant movie command.
 
In the scripts below, the movie player control on the card has ID 1.

The movie to be played was dragged and dropped intoto the project's movie library via the Movie Library menu option  under the menu Windows.
 

Use one button  to play the movie with the command MoviePlayNormalSpeed:-
Code: [Select]
MoviePlayNormalSpeed(1)


Use another button  to pause the movie with the command MoviePause:-
Code: [Select]
MoviePause(1)


As a movie player's controller is bugged, it can be hidden using the command MovieSetController.
Its usual to place this or similar commands in the card's open event:-
Code: [Select]
MovieSetController(1,0)



Attached below is a simple movie player that has a small movie in the project folder.

http://www.tigabyte.com/bits/Movie_Player.zip



More MP4 movies can be found here:-
https://file-examples.com/index.php/sample-video-files/sample-mp4-files/

77
Getting Started / Standalone Location & Movie Help
« Last post by Dystopia on October 22, 2020, 06:57:06 AM »
I tried compiling my program. It goes through alright. Now I'm having issues finding where it puts the file.

As for movies, when I run my program and try to start the movie, it doesn't start. What am I doing wrong?
78
Files / Re: Save & Load Data from file
« Last post by Malkom on October 03, 2020, 10:38:39 AM »
Hello, I want to ask a question.
Does HyperNext support save/load data from the XML/JSON/Plain text file? Like, save a value of a variable(s), load value of a variable from a file, etc.
Because I want to save my program data and settings there.

HN doesn't have support for XML/JSON but can easily write files to text or binary files.

By default when an HN program/stack closes it automatically saves all of its local and global variables, including content of fields etc.
Then the next time the HN program/stack is run those variables etc are automatically reloaded.
This makes it much easier for beginner programmers.
79
Getting Started / Re: Function system
« Last post by Malkom on October 03, 2020, 08:11:02 AM »
Yes it is possible to create your own user-defined functions but they are clumsy to call compared to a HN defined function.

In most programming languages the user-defined and language defined function usages are very similar.

Here is how to do it in HN:-

(1) Create a procedure for instance MyAddFN with any required parameters
     You can create your procedure in a the MainCode section where it will be global.
     Procedures can also be created in cards, buttons etc, where they will be local.

Code: [Select]
@ MyAddFN(n1,n2) - simply adds 2 numbers together
Global myResultAddFN

Put n1 into myResultAddFN

Add n2 to myResultAddFN

(2) In your button place the call to your procedure MyAddFN

Code: [Select]
Global myResultAddFN

Call MyAddFN(2,3)

Put myResultAddFN into field 1
@ 5 should appear in field 1

I try to keep the global variable names similar to the user-defined functions(procedure) because its easier to keep track of them in large programs. However, you can name your global variables anything, as long as they don't conflict with a HN keyword or other variable.


Creating a Procedure

Procedures are created in the Script Editor using the New, Edit, Del buttons in the lower left of the editor window.
Procedures are listed in the listbox directly above these 3 buttons.
Just make sure that you have selected the correct control, card or MainCode before creating your procedure.

 

This post might help in creating procedures, also know as handlers:-
http://www.tigabyte.com/smf/index.php?topic=118.msg399#msg399
80
Getting Started / Function system
« Last post by LinesOfCodes on October 02, 2020, 11:33:37 AM »
Hello, I want to know How can I create a 'function' (user-defined procedure) and create a 'plug-in' (plug-in procedure)?
Pages: 1 ... 6 7 [8] 9 10
anything