問題タブ [dynamic-variables]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票する
3 に答える
811 参照

php - PHPの別のクラス内で静的プロパティを呼び出す

クラスの静的プロパティを別のクラス内で呼び出すことに問題があります。

戻ることを期待してThis is first propertyいますが、出力は__constructのパラメーター入力の名前にすぎません。

出力がprint_r( static::$this->property );ちょうどproperty_one

0 投票する
1 に答える
64 参照

flash - オブジェクトの Actionscript 動的変数

ActionScript で動的変数を作成するにはどうすればよいですか?

コード例:

上記のコードを実行すると、次のエラーが送出されます。

では、ここでこの場合に動的変数をどのように使用できますか?

0 投票する
1 に答える
491 参照

c++ - Eclipse 動的変数を変更して単一の C++ クラスをビルドする

動的変数 ${selected_resource_loc} を変更して、拡張機能を削除したい (そして別の拡張機能を追加できるようにしたい)。

目的は、現在選択されているファイルをビルドすることですが、そのため、コマンドに .cc ファイルは必要ありませんが、同じ名前の .o ファイルは必要です。

詳細な説明: 私はカスタマイズされた make コマンド (たとえば) を持っており、Eclipse で現在選択されているファイルが selectedFileName.cc であるmakeを実行したいと考えています。make selectedFileName.o(プロジェクトのプロパティ -> C/C++ ビルドにビルド コマンドとしてコマンドを配置します。)${selected_resource_loc}動作タブで変数を使用すると、 make selectedFileName.cc.

0 投票する
1 に答える
249 参照

c++ - Unhandled Exception while sorting the elements in a linked list xstring

I'm working on a school project, and what I need to do is to sort the elements (strings) in a circular singly linked list alphabetically.

I thought that I could create a dynamic array and fill it with the elements from the list and send the elements back to the list after the array is sorted. It works great when I first ask the program to sort it. However, when I call the sort function again it gives an error. The error occurs on the line temp[i] = head->info. It shows me the xstring header file and says "unhandled exception".

I would be so happy if you can help me. I think what I'm missing here is a very basic thing, and I'll get better if I could learn what's wrong with this code. Thank you.

Edit:

This is the code for the function

Assignment operator overloading code for the Node class.

Edit:

I realized that there is something wrong with my addToTail function. It does add new elements to tail.

However, when I use addToHead instead of addToTail in my sort function it works perfectly after the first run too.

Here is my addToTail function

And addToHead function

0 投票する
4 に答える
918 参照

javascript - この場合、IFまたはSWITCHまたは「動的関数名」を使用するベストプラクティスは何ですか

この架空の状況でのベストプラクティスを探しています。

以下の例では、関数 changeGallery0() はユニークな関数であり、changeGallery1()、changeGallery2() と同じではありません。これを解決するために変更することはできません。ただし、各関数はまったく同じデータ (newArrayData) を取ります。

このコードは「醜い」ように見えますが、正しく機能します。ギャラリーが 20 個あるとさらに醜くなります。この問題の一部は、一意の関数の呼び出しに存在することを認識していますが、私の質問を説明するのに役立ちます。

SWITCH ケースを使用する方が適切なようです。しかし、この IF ベースのソリューションに勝る利点はありますか? 「動的関数名」のように思えますが(それは存在しますか)意味がありますか?

ありがとうございました!