[Solved] Way to add basic 1 or 0?

Discuss the presentation application

[Solved] Way to add basic 1 or 0?

Postby chuckledarkly » Thu Apr 13, 2017 9:49 am

Hello again!

My last question was solved super quick but i feel like this one is much harder. Is there a way to add a basic tracker of some sort? What I mean by this is could i add a button that when clicked on will do something different depending on whether or not another button has been pressed?

If this doesn't make sense i'll explain. I am making a slideshow for kids but I want to give them different final slides based on the answers they clicked along the way. Is some sort of tally or 1 or 0 switch possible?

If you have any ideas let me know, and Thanks!
Last edited by chuckledarkly on Thu Apr 13, 2017 12:34 pm, edited 1 time in total.
windows10, OpenOffice3.1
chuckledarkly
 
Posts: 4
Joined: Thu Apr 13, 2017 5:27 am

Re: Way to add basic 1 or 0?

Postby RoryOF » Thu Apr 13, 2017 10:04 am

Let button1 set a flag to say it has been pressed. Then in button2 code add an IF condition that looks at button1 flag and does the complex operation, ELSE it does the simple button2 code. When you decide to reset the button1 flag is up to you - you might not wish it to be active for the duration of a session.
Apache OpenOffice 4.1.6 on Xubuntu 18.04.3 (mostly 64 bit version) and very infrequently on Win2K/XP
User avatar
RoryOF
Moderator
 
Posts: 29434
Joined: Sat Jan 31, 2009 9:30 pm
Location: Ireland

Re: Way to add basic 1 or 0?

Postby chuckledarkly » Thu Apr 13, 2017 10:07 am

yes that sounds like what I want to do but how would i go about it? My experience in impress is very light.
windows10, OpenOffice3.1
chuckledarkly
 
Posts: 4
Joined: Thu Apr 13, 2017 5:27 am

Re: Way to add basic 1 or 0?

Postby RoryOF » Thu Apr 13, 2017 10:13 am

You are now into OpenOffice Macro Programming; this will keep you busy and out of pubs for months, or else will drive you to drink.
Start with the OO Basic guide

There is a complete downloadable version of an earlier edition (which should adequately meet your needs) at
OO BASIC guide 3.2 PDF
Apache OpenOffice 4.1.6 on Xubuntu 18.04.3 (mostly 64 bit version) and very infrequently on Win2K/XP
User avatar
RoryOF
Moderator
 
Posts: 29434
Joined: Sat Jan 31, 2009 9:30 pm
Location: Ireland

Re: Way to add basic 1 or 0?

Postby RoryOF » Thu Apr 13, 2017 10:19 am

Some careful searches for OpenOffice (or LibreOffice) macros ought point you to existing code, which you may then need to modify for your purposes, in the light of your knowledge of BASIC or other computer coding.
Apache OpenOffice 4.1.6 on Xubuntu 18.04.3 (mostly 64 bit version) and very infrequently on Win2K/XP
User avatar
RoryOF
Moderator
 
Posts: 29434
Joined: Sat Jan 31, 2009 9:30 pm
Location: Ireland

Re: Way to add basic 1 or 0?

Postby chuckledarkly » Thu Apr 13, 2017 12:33 pm

Thanks for the info! Guess ill give it a whirl, maybe ill get lucky and fine some youtube video tutorials haha!
windows10, OpenOffice3.1
chuckledarkly
 
Posts: 4
Joined: Thu Apr 13, 2017 5:27 am

Re: [Solved] Way to add basic 1 or 0?

Postby RoryOF » Fri Apr 14, 2017 10:22 am

Youtube tutorials are no substitute for reading the documentation. The usual starting point for this is Andrew Pitonyak's works on macro programming, downloadable from
http://www.pitonyak.org/oo.php
Apache OpenOffice 4.1.6 on Xubuntu 18.04.3 (mostly 64 bit version) and very infrequently on Win2K/XP
User avatar
RoryOF
Moderator
 
Posts: 29434
Joined: Sat Jan 31, 2009 9:30 pm
Location: Ireland


Return to Impress

Who is online

Users browsing this forum: No registered users and 4 guests