Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Supported by

Problems with variables

edited March 2021 in OpenSesame

Hello,

Could you please help me understand why these errors occur in the attached draft program :

1) The [nbr_exacts] variable contains 0 when the program comes to the end at "Score" although it is incremented correctly during the loop.

2) The program is stuck because the [correct_Rep] variable "does not exist" although it is visible in the list of variables.

Thank you in advance,

Gérard

Comments

  • Hi @gerhono ,


    Thanks for uploading your experiment. That helps a lot! :)


    The program is stuck because the [correct_Rep] variable "does not exist" although it is visible in the list of variables


    The correct spelling (and the spelling that you used in the excel file) is "correct_response". If you change the reference to the variable in the sketchpad accordingly, it should work.


    The [nbr_exacts] variable contains 0 when the program comes to the end at "Score" although it is incremented correctly during the loop


    This is because you used a normal sketchpad item for showing the (updated) variable. Sketchpads are prepared in the Prepare phase of OpenSesame (i.e., when the value of the variable "nbr_exacts" was still zero). Instead, you could use a feedback item for showing the final score. In contrast to a normal sketchpad, the content of a feedback item is generated only in OpenSesame's Run phase. For more information, see here:

    Hope this helps!


    Cheers,


    Lotje

    Did you like my answer? Feel free to Buy Me A Coffee :)

  • Hi Lotje,

    Thank you very much for your fast reply. The program works, thanks to your advise.

    I understand that when an error message in OS says that "a variable does not exist" (although it is visible in the list of variables), it actually means "that variable is undefined". OK ...

    But what still worries me is the fact that I have used a standard sketchpad in place of a feedback sketchpad, with the same design, in dozens of previous programs and that they are still working, even in this latest version of OS.

    Why are they still working ? A wonderful backward compatibility ?

    May I keep those programs as they are (-> it would take a lot of time to change them) or am I at risk to crash with a future update (-> shame on me) ?

    Cheers,

    Gérard

  • Hi @gerhono ,


    But what still worries me is the fact that I have used a standard sketchpad in place of a feedback sketchpad, with the same design, in dozens of previous programs and that they are still working, even in this latest version of OS.


    But I guess you were not displaying variables that were defined on the fly, right? You can perfectly use sketchpad items to display variables that are defined in a loop item or in the Prepare tab of an inline_script item.


    For response variables (like 'correct', 'response', or 'response_time') you should indeed use a feedback item. (And this has always been the case.) If you do show response variables with a sketchpad item, the displayed values will always be "one trial behind", as in the attached example (where I had to give the response variable a default value to avoid the program from crashing with the "variable does not exist" message - which is correct terminology, because while preparing the content of the very first trial, the variable indeed does not exist yet).



    For your previous experiments: If OpenSesame did not complain that the variable you tried to display does not exist, you don't need to worry. If you did get this error message, and you solved it by giving the variable a starting value at the beginning of your experiment, it might indeed be a good idea to upload one of the experiments here so that we can have a look at it.


    Let me know what we can do for you! :)


    Cheers,


    Lotje

    Did you like my answer? Feel free to Buy Me A Coffee :)

  • edited March 2021

    Hi Lotje,

    It all fits together now !

    Thank you again for your support.

    Cheers,

    Gérard

  • Tant mieux, @gerhono ! :)

    Did you like my answer? Feel free to Buy Me A Coffee :)

Sign In or Register to comment.

agen judi bola , sportbook, casino, togel, number game, singapore, tangkas, basket, slot, poker, dominoqq, agen bola. Semua permainan bisa dimainkan hanya dengan 1 ID. minimal deposit 50.000 ,- bonus cashback hingga 10% , diskon togel hingga 66% bisa bermain di android dan IOS kapanpun dan dimana pun. poker , bandarq , aduq, domino qq , dominobet. Semua permainan bisa dimainkan hanya dengan 1 ID. minimal deposit 10.000 ,- bonus turnover 0.5% dan bonus referral 20%. Bonus - bonus yang dihadirkan bisa terbilang cukup tinggi dan memuaskan, anda hanya perlu memasang pada situs yang memberikan bursa pasaran terbaik yaitu http://45.77.173.118/ Bola168. Situs penyedia segala jenis permainan poker online kini semakin banyak ditemukan di Internet, salah satunya TahunQQ merupakan situs Agen Judi Domino66 Dan BandarQ Terpercaya yang mampu memberikan banyak provit bagi bettornya. Permainan Yang Di Sediakan Dewi365 Juga sangat banyak Dan menarik dan Peluang untuk memenangkan Taruhan Judi online ini juga sangat mudah . Mainkan Segera Taruhan Sportbook anda bersama Agen Judi Bola Bersama Dewi365 Kemenangan Anda Berapa pun akan Terbayarkan. Tersedia 9 macam permainan seru yang bisa kamu mainkan hanya di dalam 1 ID saja. Permainan seru yang tersedia seperti Poker, Domino QQ Dan juga BandarQ Online. Semuanya tersedia lengkap hanya di ABGQQ. Situs ABGQQ sangat mudah dimenangkan, kamu juga akan mendapatkan mega bonus dan setiap pemain berhak mendapatkan cashback mingguan. ABGQQ juga telah diakui sebagai Bandar Domino Online yang menjamin sistem FAIR PLAY disetiap permainan yang bisa dimainkan dengan deposit minimal hanya Rp.25.000. DEWI365 adalah Bandar Judi Bola Terpercaya & resmi dan terpercaya di indonesia. Situs judi bola ini menyediakan fasilitas bagi anda untuk dapat bermain memainkan permainan judi bola. Didalam situs ini memiliki berbagai permainan taruhan bola terlengkap seperti Sbobet, yang membuat DEWI365 menjadi situs judi bola terbaik dan terpercaya di Indonesia. Tentunya sebagai situs yang bertugas sebagai Bandar Poker Online pastinya akan berusaha untuk menjaga semua informasi dan keamanan yang terdapat di POKERQQ13. Kotakqq adalah situs Judi Poker Online Terpercayayang menyediakan 9 jenis permainan sakong online, dominoqq, domino99, bandarq, bandar ceme, aduq, poker online, bandar poker, balak66, perang baccarat, dan capsa susun. Dengan minimal deposit withdraw 15.000 Anda sudah bisa memainkan semua permaina pkv games di situs kami. Jackpot besar,Win rate tinggi, Fair play, PKV Games